Upload merve_smol-vision_1.py with huggingface_hub
Browse files- merve_smol-vision_1.py +6 -8
merve_smol-vision_1.py
CHANGED
|
@@ -11,10 +11,9 @@
|
|
| 11 |
# ///
|
| 12 |
|
| 13 |
try:
|
| 14 |
-
#
|
| 15 |
-
from transformers import
|
| 16 |
-
|
| 17 |
-
pipe = pipeline("image-text-to-text", model="merve/smol-vision")
|
| 18 |
with open('merve_smol-vision_1.txt', 'w', encoding='utf-8') as f:
|
| 19 |
f.write('Everything was good in merve_smol-vision_1.txt')
|
| 20 |
except Exception as e:
|
|
@@ -29,10 +28,9 @@ except Exception as e:
|
|
| 29 |
with open('merve_smol-vision_1.txt', 'a', encoding='utf-8') as f:
|
| 30 |
import traceback
|
| 31 |
f.write('''```CODE:
|
| 32 |
-
#
|
| 33 |
-
from transformers import
|
| 34 |
-
|
| 35 |
-
pipe = pipeline("image-text-to-text", model="merve/smol-vision")
|
| 36 |
```
|
| 37 |
|
| 38 |
ERROR:
|
|
|
|
| 11 |
# ///
|
| 12 |
|
| 13 |
try:
|
| 14 |
+
# Load model directly
|
| 15 |
+
from transformers import AutoModel
|
| 16 |
+
model = AutoModel.from_pretrained("merve/smol-vision", torch_dtype="auto")
|
|
|
|
| 17 |
with open('merve_smol-vision_1.txt', 'w', encoding='utf-8') as f:
|
| 18 |
f.write('Everything was good in merve_smol-vision_1.txt')
|
| 19 |
except Exception as e:
|
|
|
|
| 28 |
with open('merve_smol-vision_1.txt', 'a', encoding='utf-8') as f:
|
| 29 |
import traceback
|
| 30 |
f.write('''```CODE:
|
| 31 |
+
# Load model directly
|
| 32 |
+
from transformers import AutoModel
|
| 33 |
+
model = AutoModel.from_pretrained("merve/smol-vision", torch_dtype="auto")
|
|
|
|
| 34 |
```
|
| 35 |
|
| 36 |
ERROR:
|