Spaces:
Sleeping
Sleeping
Brice Vandeputte
commited on
Commit
•
ad123c8
1
Parent(s):
87af1f8
add api button
Browse files
app.py
CHANGED
@@ -227,6 +227,7 @@ if __name__ == "__main__":
|
|
227 |
type="index",
|
228 |
)
|
229 |
open_domain_btn = gr.Button("Submit", variant="primary")
|
|
|
230 |
with gr.Column():
|
231 |
open_domain_output = gr.Label(
|
232 |
num_top_classes=k,
|
@@ -309,6 +310,12 @@ if __name__ == "__main__":
|
|
309 |
outputs=[open_domain_output],
|
310 |
)
|
311 |
|
|
|
|
|
|
|
|
|
|
|
|
|
312 |
zero_shot_btn.click(
|
313 |
fn=zero_shot_classification,
|
314 |
inputs=[img_input, classes_txt],
|
|
|
227 |
type="index",
|
228 |
)
|
229 |
open_domain_btn = gr.Button("Submit", variant="primary")
|
230 |
+
api_classification_btn = gr.Button("API", variant="primary")
|
231 |
with gr.Column():
|
232 |
open_domain_output = gr.Label(
|
233 |
num_top_classes=k,
|
|
|
310 |
outputs=[open_domain_output],
|
311 |
)
|
312 |
|
313 |
+
api_classification_btn.click(
|
314 |
+
fn=api_classification,
|
315 |
+
inputs=[img_input, rank_dropdown],
|
316 |
+
outputs=[open_domain_output],
|
317 |
+
)
|
318 |
+
|
319 |
zero_shot_btn.click(
|
320 |
fn=zero_shot_classification,
|
321 |
inputs=[img_input, classes_txt],
|