hsienchen commited on
Commit
a7e8129
1 Parent(s): 77fbc21

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -4
app.py CHANGED
@@ -52,8 +52,8 @@ def sentence_builder(animal, place):
52
 
53
  # gradio block
54
 
55
- with gr.Blocks(theme='snehilsanyal/scikit-learn') as app:
56
- gr.Markdown("## MM COT ##")
57
  with gr.Row():
58
  image_box = gr.Image(type="filepath")
59
 
@@ -81,6 +81,29 @@ with gr.Blocks(theme='snehilsanyal/scikit-learn') as app:
81
  Multimodal-CoT incorporates vision features in a decoupled training framework. The framework consists of two training stages: (i) rationale generation and (ii) answer inference. Both stages share the same model architecture but differ in the input and output.
82
  """)
83
 
 
 
 
 
84
 
85
- app.queue()
86
- app.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
 
53
  # gradio block
54
 
55
+ with gr.Blocks(theme='snehilsanyal/scikit-learn') as app1:
56
+ gr.Markdown("## COT ##")
57
  with gr.Row():
58
  image_box = gr.Image(type="filepath")
59
 
 
81
  Multimodal-CoT incorporates vision features in a decoupled training framework. The framework consists of two training stages: (i) rationale generation and (ii) answer inference. Both stages share the same model architecture but differ in the input and output.
82
  """)
83
 
84
+ with gr.Blocks(theme='snehilsanyal/scikit-learn') as app2:
85
+ gr.Markdown("## MM 2 ##")
86
+ with gr.Row():
87
+ image_box = gr.Image(type="filepath")
88
 
89
+ chatbot = gr.Chatbot(
90
+ scale = 2,
91
+ height=750
92
+ )
93
+ text_box = gr.Dropdown(
94
+ ["what is in the image", "provide alternative title for the image", "how many birds can be seen in the picture?"], label="Animal", info="Will add more animals later!"
95
+ )
96
+
97
+ btn = gr.Button("Submit")
98
+ clicked = btn.click(query_message,
99
+ [chatbot,text_box,image_box],
100
+ chatbot
101
+ ).then(llm_response,
102
+ [chatbot,text_box,image_box],
103
+ chatbot
104
+ )
105
+
106
+ demo = gr.TabbedInterface([app1, app2], ["APP #1", "APP #2"])
107
+
108
+ demo.queue()
109
+ demo.launch()