arad1367 commited on
Commit
ebba846
1 Parent(s): a60be78

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -10
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
- iface = gr.Interface(
36
- fn=generate_response,
37
- inputs=[gr.Image(type="pil"), "text"],
38
- outputs="text",
39
- title="Visual Question Answering - Financial charts analysis",
40
- description="Input an image and a question related to the image to receive a response.",
41
- theme='abidlabs/dracula_revamped'
42
- )
43
 
44
  # Launch the app
45
- iface.launch(debug=True)
 
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)