Spaces:
Runtime error
Runtime error
Add API endpoint to flag misdetections
Browse files
app.py
CHANGED
|
@@ -125,7 +125,7 @@ with gr.Blocks(theme=theme, css=css, title="SEA.AI Vision Demo") as demo:
|
|
| 125 |
hf_writer.setup([img_input], "flagged")
|
| 126 |
|
| 127 |
# Sequential logic when flag button is clicked
|
| 128 |
-
flag.click(lambda: gr.Info("Thank you for contributing!"), show_api=
|
| 129 |
lambda: {flag: gr.Button(FLAG_TXT, interactive=False)},
|
| 130 |
[],
|
| 131 |
[flag],
|
|
@@ -141,7 +141,7 @@ with gr.Blocks(theme=theme, css=css, title="SEA.AI Vision Demo") as demo:
|
|
| 141 |
)
|
| 142 |
|
| 143 |
# called during initial load in browser
|
| 144 |
-
demo.load(lambda: load_badges(flagged_counter.count()), [], badges, show_api=
|
| 145 |
|
| 146 |
if __name__ == "__main__":
|
| 147 |
demo.queue().launch()
|
|
|
|
| 125 |
hf_writer.setup([img_input], "flagged")
|
| 126 |
|
| 127 |
# Sequential logic when flag button is clicked
|
| 128 |
+
flag.click(lambda: gr.Info("Thank you for contributing!"), show_api=True, api_name="flag_misdetection").then(
|
| 129 |
lambda: {flag: gr.Button(FLAG_TXT, interactive=False)},
|
| 130 |
[],
|
| 131 |
[flag],
|
|
|
|
| 141 |
)
|
| 142 |
|
| 143 |
# called during initial load in browser
|
| 144 |
+
demo.load(lambda: load_badges(flagged_counter.count()), [], badges, show_api=False)
|
| 145 |
|
| 146 |
if __name__ == "__main__":
|
| 147 |
demo.queue().launch()
|