Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -186,13 +186,13 @@ def process_document(llm, num_shot, image, question):
|
|
186 |
table = processor_deplot.decode(predictions[0], skip_special_tokens=True).replace("<0x0A>", "\n")
|
187 |
|
188 |
# send prompt+table to LLM
|
189 |
-
res = evaluate(table,
|
190 |
if llm == "alpaca-lora":
|
191 |
return [table, res.split("A:")[-1]]
|
192 |
else:
|
193 |
return [table, res]
|
194 |
|
195 |
-
description = "Demo for DePlot+LLM for QA and summarisation. [DePlot](https://arxiv.org/abs/2212.10505) is an image-to-text model that converts plots and charts into a textual sequence. The sequence then is used to prompt LLM for chain-of-thought reasoning. The current underlying
|
196 |
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2212.10505' target='_blank'>DePlot: One-shot visual language reasoning by plot-to-table translation</a></p>"
|
197 |
|
198 |
demo = gr.Interface(
|
|
|
186 |
table = processor_deplot.decode(predictions[0], skip_special_tokens=True).replace("<0x0A>", "\n")
|
187 |
|
188 |
# send prompt+table to LLM
|
189 |
+
res = evaluate(table, question, llm=llm, num_shot=num_shot)
|
190 |
if llm == "alpaca-lora":
|
191 |
return [table, res.split("A:")[-1]]
|
192 |
else:
|
193 |
return [table, res]
|
194 |
|
195 |
+
description = "Demo for DePlot+LLM for QA and summarisation. [DePlot](https://arxiv.org/abs/2212.10505) is an image-to-text model that converts plots and charts into a textual sequence. The sequence then is used to prompt LLM for chain-of-thought reasoning. The current underlying LLMs are [alpaca-lora](https://huggingface.co/spaces/tloen/alpaca-lora) and [flan-ul2](https://huggingface.co/google/flan-ul2). To use it, simply upload your image and type a question or instruction and click 'submit', or click one of the examples to load them. Read more at the links below."
|
196 |
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2212.10505' target='_blank'>DePlot: One-shot visual language reasoning by plot-to-table translation</a></p>"
|
197 |
|
198 |
demo = gr.Interface(
|