Update app.py
Browse files
app.py
CHANGED
|
@@ -20,6 +20,7 @@ model.to(device)
|
|
| 20 |
def extract_chart_data(img: Image.Image, header_text:str):
|
| 21 |
# Provide a header prompt for VQA
|
| 22 |
# header_text = "Convert this bar chart into a table of quarter and cost values"
|
|
|
|
| 23 |
|
| 24 |
inputs = processor(images=img, text=header_text, return_tensors="pt").to(device)
|
| 25 |
outputs = model.generate(**inputs)
|
|
@@ -39,7 +40,7 @@ iface = gr.Interface(
|
|
| 39 |
) # Text input
|
| 40 |
],
|
| 41 |
outputs="text",
|
| 42 |
-
title="DePlot Chart Data Extractor
|
| 43 |
description="Upload a chart image and get its extracted data/description."
|
| 44 |
)
|
| 45 |
|
|
|
|
| 20 |
def extract_chart_data(img: Image.Image, header_text:str):
|
| 21 |
# Provide a header prompt for VQA
|
| 22 |
# header_text = "Convert this bar chart into a table of quarter and cost values"
|
| 23 |
+
print("Header text:", header_text)
|
| 24 |
|
| 25 |
inputs = processor(images=img, text=header_text, return_tensors="pt").to(device)
|
| 26 |
outputs = model.generate(**inputs)
|
|
|
|
| 40 |
) # Text input
|
| 41 |
],
|
| 42 |
outputs="text",
|
| 43 |
+
title="DePlot Chart Data Extractor 1",
|
| 44 |
description="Upload a chart image and get its extracted data/description."
|
| 45 |
)
|
| 46 |
|