Upload deepseek-ai_DeepSeek-OCR_0.py with huggingface_hub
Browse files
deepseek-ai_DeepSeek-OCR_0.py
CHANGED
|
@@ -24,16 +24,6 @@ try:
|
|
| 24 |
from transformers import pipeline
|
| 25 |
|
| 26 |
pipe = pipeline("image-text-to-text", model="deepseek-ai/DeepSeek-OCR", trust_remote_code=True)
|
| 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('deepseek-ai_DeepSeek-OCR_0.txt', 'w', encoding='utf-8') as f:
|
| 38 |
f.write('Everything was good in deepseek-ai_DeepSeek-OCR_0.txt')
|
| 39 |
except Exception as e:
|
|
@@ -52,16 +42,6 @@ except Exception as e:
|
|
| 52 |
from transformers import pipeline
|
| 53 |
|
| 54 |
pipe = pipeline("image-text-to-text", model="deepseek-ai/DeepSeek-OCR", trust_remote_code=True)
|
| 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:
|
|
|
|
| 24 |
from transformers import pipeline
|
| 25 |
|
| 26 |
pipe = pipeline("image-text-to-text", model="deepseek-ai/DeepSeek-OCR", trust_remote_code=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
with open('deepseek-ai_DeepSeek-OCR_0.txt', 'w', encoding='utf-8') as f:
|
| 28 |
f.write('Everything was good in deepseek-ai_DeepSeek-OCR_0.txt')
|
| 29 |
except Exception as e:
|
|
|
|
| 42 |
from transformers import pipeline
|
| 43 |
|
| 44 |
pipe = pipeline("image-text-to-text", model="deepseek-ai/DeepSeek-OCR", trust_remote_code=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
```
|
| 46 |
|
| 47 |
ERROR:
|