Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -30,16 +30,26 @@ def generate_response(image, question):
|
|
| 30 |
generated_text += new_text
|
| 31 |
return generated_text
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
-
# Create a Gradio interface
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
)
|
| 43 |
|
| 44 |
# Launch the app
|
| 45 |
-
|
|
|
|
| 30 |
generated_text += new_text
|
| 31 |
return generated_text
|
| 32 |
|
| 33 |
+
# Create the footer with links
|
| 34 |
+
footer = """
|
| 35 |
+
<div style="text-align: center; margin-top: 20px;">
|
| 36 |
+
<a href="https://www.linkedin.com/in/pejman-ebrahimi-4a60151a7/" target="_blank">LinkedIn</a> |
|
| 37 |
+
<a href="https://github.com/arad1367/Visual_QA_MiniCPM-Llama3-V-2_5_GradioApp" target="_blank">GitHub</a> |
|
| 38 |
+
<a href="https://arad1367.pythonanywhere.com/" target="_blank">Live demo of my PhD defense</a>
|
| 39 |
+
<br>
|
| 40 |
+
Made with love by Pejman Ebrahimi
|
| 41 |
+
</div>
|
| 42 |
+
"""
|
| 43 |
|
| 44 |
+
# Create a Gradio interface using gr.Blocks
|
| 45 |
+
with gr.Blocks(theme='abidlabs/dracula_revamped') as demo:
|
| 46 |
+
gr.Markdown("Visual Question Answering - Financial charts analysis")
|
| 47 |
+
gr.Markdown("Input an image and a question related to the image to receive a response.")
|
| 48 |
+
image_input = gr.Image(type="pil", label="Image")
|
| 49 |
+
question_input = gr.Textbox(label="Question")
|
| 50 |
+
output_text = gr.Textbox(label="Response")
|
| 51 |
+
image_input.change(generate_response, inputs=[image_input, question_input], outputs=output_text)
|
| 52 |
+
gr.HTML(footer)
|
| 53 |
|
| 54 |
# Launch the app
|
| 55 |
+
demo.launch(debug=True)
|