Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ def load_model():
|
|
13 |
# Extract text from image using SmolVLM
|
14 |
def extract_text(image, processor, model):
|
15 |
# Preprocess image
|
16 |
-
inputs = processor(images=image, text="What is the text in this image?", return_tensors="pt")
|
17 |
|
18 |
with torch.no_grad():
|
19 |
outputs = model.generate(**inputs)
|
|
|
13 |
# Extract text from image using SmolVLM
|
14 |
def extract_text(image, processor, model):
|
15 |
# Preprocess image
|
16 |
+
inputs = processor(images=image, text="What is the text in this image? extract all data in JSON format", return_tensors="pt")
|
17 |
|
18 |
with torch.no_grad():
|
19 |
outputs = model.generate(**inputs)
|