Spaces:
Sleeping
Sleeping
Commit
·
5214878
1
Parent(s):
a4bc7df
Update app.py
Browse files
app.py
CHANGED
|
@@ -69,7 +69,7 @@ def update(user_choice, left, right, data_folder=VIDEO_PATH, flag_to_huggingface
|
|
| 69 |
writer_object = writer(file)
|
| 70 |
writer_object.writerow(info)
|
| 71 |
file.close()
|
| 72 |
-
if int(current_time.split('-')[-2]) %
|
| 73 |
try:
|
| 74 |
repo.push_to_hub(commit_message=f"Flagged sample at {current_time}")
|
| 75 |
except:
|
|
@@ -144,7 +144,7 @@ def build_interface(iter=3, data_folder=VIDEO_PATH):
|
|
| 144 |
callback.setup([user_choice, left, right], "flagged_data_points")
|
| 145 |
|
| 146 |
btn1.click(fn=replay, inputs=[left, right], outputs=[left, right])
|
| 147 |
-
btn2.click(fn=update, inputs=[user_choice], outputs=[left, right])
|
| 148 |
|
| 149 |
# We can choose which components to flag -- in this case, we'll flag all of them
|
| 150 |
btn2.click(lambda *args: callback.flag(args), [user_choice, left, right], None, preprocess=False)
|
|
|
|
| 69 |
writer_object = writer(file)
|
| 70 |
writer_object.writerow(info)
|
| 71 |
file.close()
|
| 72 |
+
if int(current_time.split('-')[-2]) % 5 == 0: # push only on certain minutes
|
| 73 |
try:
|
| 74 |
repo.push_to_hub(commit_message=f"Flagged sample at {current_time}")
|
| 75 |
except:
|
|
|
|
| 144 |
callback.setup([user_choice, left, right], "flagged_data_points")
|
| 145 |
|
| 146 |
btn1.click(fn=replay, inputs=[left, right], outputs=[left, right])
|
| 147 |
+
btn2.click(fn=update, inputs=[user_choice, left, right], outputs=[left, right])
|
| 148 |
|
| 149 |
# We can choose which components to flag -- in this case, we'll flag all of them
|
| 150 |
btn2.click(lambda *args: callback.flag(args), [user_choice, left, right], None, preprocess=False)
|