File size: 357 Bytes
05cb41b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import ollama

with open("handwriting.png", "rb") as f:
    image_data = f.read()

response = ollama.chat(
    model="deepseek-ocr",
    messages=[
        {
            "role": "user",
            "content": "Extract all text from this medical prescription image.",
            "images": [image_data]
        }
    ]
)
print(response["message"]["content"])