Update app.py
Browse files
app.py
CHANGED
@@ -116,6 +116,13 @@ def main(text_input="", image_input=None, unit=""):
|
|
116 |
elif image_input is not None:
|
117 |
return process_image(image_input,unit)
|
118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
with gr.Blocks(theme='shivi/calm_seafoam', css=css, title="知觉demo") as iface:
|
120 |
with gr.Accordion(""):
|
121 |
gr.Markdown(DESCRIPTION)
|
@@ -133,7 +140,7 @@ with gr.Blocks(theme='shivi/calm_seafoam', css=css, title="知觉demo") as iface
|
|
133 |
|
134 |
# Set up the event listeners
|
135 |
submit_btn.click(main, inputs=[text_input, image_input, unit], outputs=output_box)
|
136 |
-
|
137 |
gr.Markdown(LICENSE)
|
138 |
|
139 |
#gr.close_all()
|
|
|
116 |
elif image_input is not None:
|
117 |
return process_image(image_input,unit)
|
118 |
|
119 |
+
EXAMPLES = [
|
120 |
+
[["./docs/estate.jpeg"],""],
|
121 |
+
[["./docs/pop.jpeg"],""],
|
122 |
+
[["./docs/debt.jpeg"],""],
|
123 |
+
[[],"中国央行表示高度关注当前债券市场变化及潜在风险,必要时会进行卖出低风险债券包括国债操作。"],
|
124 |
+
]
|
125 |
+
|
126 |
with gr.Blocks(theme='shivi/calm_seafoam', css=css, title="知觉demo") as iface:
|
127 |
with gr.Accordion(""):
|
128 |
gr.Markdown(DESCRIPTION)
|
|
|
140 |
|
141 |
# Set up the event listeners
|
142 |
submit_btn.click(main, inputs=[text_input, image_input, unit], outputs=output_box)
|
143 |
+
gr.Examples(EXAMPLES, [image_input, text_input], cache_examples = "lazy")
|
144 |
gr.Markdown(LICENSE)
|
145 |
|
146 |
#gr.close_all()
|