Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,7 +40,20 @@ def predict(image, input_prompt):
|
|
| 40 |
sequence = re.sub(r"<.*?>", "", sequence, count=2).strip()
|
| 41 |
return sequence
|
| 42 |
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
image = gr.components.Image(type="pil", label="Chart Image")
|
| 45 |
input_prompt = gr.components.Textbox(label="Input Prompt")
|
| 46 |
model_output = gr.components.Textbox(label="Model Output")
|
|
@@ -53,6 +66,7 @@ interface = gr.Interface(fn=predict,
|
|
| 53 |
outputs=model_output,
|
| 54 |
examples=examples,
|
| 55 |
title=title,
|
|
|
|
| 56 |
theme='gradio/soft')
|
| 57 |
|
| 58 |
interface.launch()
|
|
|
|
| 40 |
sequence = re.sub(r"<.*?>", "", sequence, count=2).strip()
|
| 41 |
return sequence
|
| 42 |
|
| 43 |
+
|
| 44 |
+
instructions = f"""
|
| 45 |
+
Demo of the [UniChart Base](https://huggingface.co/ahmed-masry/unichart-base-960) Model
|
| 46 |
+
Learn more about the model by reading [our paper](https://arxiv.org/abs/2305.14761) and explore the [code](https://github.com/vis-nlp/UniChart)
|
| 47 |
+
|
| 48 |
+
You can use UniChart for the following tasks:
|
| 49 |
+
| Task | Input Prompt |
|
| 50 |
+
| ------------- | ------------- |
|
| 51 |
+
| Chart Summarization | \<summarize_chart\> |
|
| 52 |
+
| Chart to Table | \<extract_data_table\> |
|
| 53 |
+
| Open Chart Question Answering | \<opencqa\> question |
|
| 54 |
+
|
| 55 |
+
"""
|
| 56 |
+
|
| 57 |
image = gr.components.Image(type="pil", label="Chart Image")
|
| 58 |
input_prompt = gr.components.Textbox(label="Input Prompt")
|
| 59 |
model_output = gr.components.Textbox(label="Model Output")
|
|
|
|
| 66 |
outputs=model_output,
|
| 67 |
examples=examples,
|
| 68 |
title=title,
|
| 69 |
+
description=instructions,
|
| 70 |
theme='gradio/soft')
|
| 71 |
|
| 72 |
interface.launch()
|