Spaces:
Sleeping
Sleeping
thompsonmj
commited on
Commit
•
65a969c
1
Parent(s):
ef07580
Disable Flag Mistake buttons for Open-Domain and Zero-Shot predictions
Browse files
app.py
CHANGED
@@ -199,7 +199,7 @@ if __name__ == "__main__":
|
|
199 |
show_label=True,
|
200 |
value=None,
|
201 |
)
|
202 |
-
open_domain_flag_btn = gr.Button("Flag Mistake", variant="primary")
|
203 |
|
204 |
with gr.Row():
|
205 |
gr.Examples(
|
@@ -210,19 +210,19 @@ if __name__ == "__main__":
|
|
210 |
outputs=[open_domain_output],
|
211 |
)
|
212 |
|
213 |
-
open_domain_callback = gr.HuggingFaceDatasetSaver(
|
214 |
-
|
215 |
-
)
|
216 |
-
open_domain_callback.setup(
|
217 |
-
|
218 |
-
|
219 |
-
)
|
220 |
-
open_domain_flag_btn.click(
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
)
|
226 |
|
227 |
with gr.Tab("Zero-Shot"):
|
228 |
with gr.Row():
|
@@ -240,7 +240,7 @@ if __name__ == "__main__":
|
|
240 |
zero_shot_output = gr.Label(
|
241 |
num_top_classes=k, label="Prediction", show_label=True
|
242 |
)
|
243 |
-
zero_shot_flag_btn = gr.Button("Flag Mistake", variant="primary")
|
244 |
|
245 |
with gr.Row():
|
246 |
gr.Examples(
|
@@ -251,18 +251,18 @@ if __name__ == "__main__":
|
|
251 |
outputs=[zero_shot_output],
|
252 |
)
|
253 |
|
254 |
-
zero_shot_callback = gr.HuggingFaceDatasetSaver(
|
255 |
-
|
256 |
-
)
|
257 |
-
zero_shot_callback.setup(
|
258 |
-
|
259 |
-
)
|
260 |
-
zero_shot_flag_btn.click(
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
)
|
266 |
|
267 |
rank_dropdown.change(
|
268 |
fn=change_output, inputs=rank_dropdown, outputs=[open_domain_output]
|
|
|
199 |
show_label=True,
|
200 |
value=None,
|
201 |
)
|
202 |
+
# open_domain_flag_btn = gr.Button("Flag Mistake", variant="primary")
|
203 |
|
204 |
with gr.Row():
|
205 |
gr.Examples(
|
|
|
210 |
outputs=[open_domain_output],
|
211 |
)
|
212 |
|
213 |
+
# open_domain_callback = gr.HuggingFaceDatasetSaver(
|
214 |
+
# hf_token, "imageomics/bioclip-demo-open-domain-mistakes", private=True
|
215 |
+
# )
|
216 |
+
# open_domain_callback.setup(
|
217 |
+
# [img_input, rank_dropdown, open_domain_output],
|
218 |
+
# flagging_dir="logs/flagged",
|
219 |
+
# )
|
220 |
+
# open_domain_flag_btn.click(
|
221 |
+
# lambda *args: open_domain_callback.flag(args),
|
222 |
+
# [img_input, rank_dropdown, open_domain_output],
|
223 |
+
# None,
|
224 |
+
# preprocess=False,
|
225 |
+
# )
|
226 |
|
227 |
with gr.Tab("Zero-Shot"):
|
228 |
with gr.Row():
|
|
|
240 |
zero_shot_output = gr.Label(
|
241 |
num_top_classes=k, label="Prediction", show_label=True
|
242 |
)
|
243 |
+
# zero_shot_flag_btn = gr.Button("Flag Mistake", variant="primary")
|
244 |
|
245 |
with gr.Row():
|
246 |
gr.Examples(
|
|
|
251 |
outputs=[zero_shot_output],
|
252 |
)
|
253 |
|
254 |
+
# zero_shot_callback = gr.HuggingFaceDatasetSaver(
|
255 |
+
# hf_token, "imageomics/bioclip-demo-zero-shot-mistakes", private=True
|
256 |
+
# )
|
257 |
+
# zero_shot_callback.setup(
|
258 |
+
# [img_input, zero_shot_output], flagging_dir="logs/flagged"
|
259 |
+
# )
|
260 |
+
# zero_shot_flag_btn.click(
|
261 |
+
# lambda *args: zero_shot_callback.flag(args),
|
262 |
+
# [img_input, zero_shot_output],
|
263 |
+
# None,
|
264 |
+
# preprocess=False,
|
265 |
+
# )
|
266 |
|
267 |
rank_dropdown.change(
|
268 |
fn=change_output, inputs=rank_dropdown, outputs=[open_domain_output]
|