ariG23498 HF Staff commited on
Commit
940ec23
·
verified ·
1 Parent(s): 3922c99

Upload google_medgemma-4b-it_0.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. google_medgemma-4b-it_0.py +2 -14
google_medgemma-4b-it_0.py CHANGED
@@ -7,20 +7,8 @@
7
  # ///
8
 
9
  try:
10
- # Use a pipeline as a high-level helper
11
- from transformers import pipeline
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: