Upload ServiceNow-AI_Apriel-1.6-15b-Thinker_0.py with huggingface_hub
Browse files
ServiceNow-AI_Apriel-1.6-15b-Thinker_0.py
CHANGED
|
@@ -20,8 +20,20 @@
|
|
| 20 |
# ///
|
| 21 |
|
| 22 |
try:
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
with open('ServiceNow-AI_Apriel-1.6-15b-Thinker_0.txt', 'w', encoding='utf-8') as f:
|
| 26 |
f.write('Everything was good in ServiceNow-AI_Apriel-1.6-15b-Thinker_0.txt')
|
| 27 |
except Exception as e:
|
|
@@ -36,8 +48,20 @@ except Exception as e:
|
|
| 36 |
with open('ServiceNow-AI_Apriel-1.6-15b-Thinker_0.txt', 'a', encoding='utf-8') as f:
|
| 37 |
import traceback
|
| 38 |
f.write('''```CODE:
|
| 39 |
-
|
| 40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
```
|
| 42 |
|
| 43 |
ERROR:
|
|
|
|
| 20 |
# ///
|
| 21 |
|
| 22 |
try:
|
| 23 |
+
# Use a pipeline as a high-level helper
|
| 24 |
+
from transformers import pipeline
|
| 25 |
+
|
| 26 |
+
pipe = pipeline("image-text-to-text", model="ServiceNow-AI/Apriel-1.6-15b-Thinker")
|
| 27 |
+
messages = [
|
| 28 |
+
{
|
| 29 |
+
"role": "user",
|
| 30 |
+
"content": [
|
| 31 |
+
{"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
|
| 32 |
+
{"type": "text", "text": "What animal is on the candy?"}
|
| 33 |
+
]
|
| 34 |
+
},
|
| 35 |
+
]
|
| 36 |
+
pipe(text=messages)
|
| 37 |
with open('ServiceNow-AI_Apriel-1.6-15b-Thinker_0.txt', 'w', encoding='utf-8') as f:
|
| 38 |
f.write('Everything was good in ServiceNow-AI_Apriel-1.6-15b-Thinker_0.txt')
|
| 39 |
except Exception as e:
|
|
|
|
| 48 |
with open('ServiceNow-AI_Apriel-1.6-15b-Thinker_0.txt', 'a', encoding='utf-8') as f:
|
| 49 |
import traceback
|
| 50 |
f.write('''```CODE:
|
| 51 |
+
# Use a pipeline as a high-level helper
|
| 52 |
+
from transformers import pipeline
|
| 53 |
+
|
| 54 |
+
pipe = pipeline("image-text-to-text", model="ServiceNow-AI/Apriel-1.6-15b-Thinker")
|
| 55 |
+
messages = [
|
| 56 |
+
{
|
| 57 |
+
"role": "user",
|
| 58 |
+
"content": [
|
| 59 |
+
{"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
|
| 60 |
+
{"type": "text", "text": "What animal is on the candy?"}
|
| 61 |
+
]
|
| 62 |
+
},
|
| 63 |
+
]
|
| 64 |
+
pipe(text=messages)
|
| 65 |
```
|
| 66 |
|
| 67 |
ERROR:
|