Upload google_medgemma-4b-it_0.py with huggingface_hub
Browse files- google_medgemma-4b-it_0.py +2 -14
google_medgemma-4b-it_0.py
CHANGED
@@ -7,20 +7,8 @@
|
|
7 |
# ///
|
8 |
|
9 |
try:
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
pipe = pipeline("image-text-to-text", model="google/medgemma-4b-it")
|
14 |
-
messages = [
|
15 |
-
{
|
16 |
-
"role": "user",
|
17 |
-
"content": [
|
18 |
-
{"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
|
19 |
-
{"type": "text", "text": "What animal is on the candy?"}
|
20 |
-
]
|
21 |
-
},
|
22 |
-
]
|
23 |
-
pipe(text=messages)
|
24 |
with open('google_medgemma-4b-it_0.txt', 'w') as f:
|
25 |
f.write('Everything was good in google_medgemma-4b-it_0.txt')
|
26 |
except Exception as e:
|
|
|
7 |
# ///
|
8 |
|
9 |
try:
|
10 |
+
from huggingface_hub import login
|
11 |
+
login(new_session=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
with open('google_medgemma-4b-it_0.txt', 'w') as f:
|
13 |
f.write('Everything was good in google_medgemma-4b-it_0.txt')
|
14 |
except Exception as e:
|