Upload datalab-to_chandra_0.py with huggingface_hub
Browse files- datalab-to_chandra_0.py +8 -2
datalab-to_chandra_0.py
CHANGED
|
@@ -11,7 +11,10 @@
|
|
| 11 |
# ///
|
| 12 |
|
| 13 |
try:
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
| 15 |
with open('datalab-to_chandra_0.txt', 'w', encoding='utf-8') as f:
|
| 16 |
f.write('Everything was good in datalab-to_chandra_0.txt')
|
| 17 |
except Exception as e:
|
|
@@ -26,7 +29,10 @@ except Exception as e:
|
|
| 26 |
with open('datalab-to_chandra_0.txt', 'a', encoding='utf-8') as f:
|
| 27 |
import traceback
|
| 28 |
f.write('''```CODE:
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
| 30 |
```
|
| 31 |
|
| 32 |
ERROR:
|
|
|
|
| 11 |
# ///
|
| 12 |
|
| 13 |
try:
|
| 14 |
+
# Use a pipeline as a high-level helper
|
| 15 |
+
from transformers import pipeline
|
| 16 |
+
|
| 17 |
+
pipe = pipeline("image-to-text", model="datalab-to/chandra")
|
| 18 |
with open('datalab-to_chandra_0.txt', 'w', encoding='utf-8') as f:
|
| 19 |
f.write('Everything was good in datalab-to_chandra_0.txt')
|
| 20 |
except Exception as e:
|
|
|
|
| 29 |
with open('datalab-to_chandra_0.txt', 'a', encoding='utf-8') as f:
|
| 30 |
import traceback
|
| 31 |
f.write('''```CODE:
|
| 32 |
+
# Use a pipeline as a high-level helper
|
| 33 |
+
from transformers import pipeline
|
| 34 |
+
|
| 35 |
+
pipe = pipeline("image-to-text", model="datalab-to/chandra")
|
| 36 |
```
|
| 37 |
|
| 38 |
ERROR:
|