Spaces:
Sleeping
Sleeping
rmv: timer
Browse files- src/submission/submit.py +0 -8
src/submission/submit.py
CHANGED
|
@@ -98,13 +98,6 @@ def submit_leaderboard_to_hub(entries: List[Dict], version="v0") -> Tuple[bool,
|
|
| 98 |
except Exception as e:
|
| 99 |
return False, f"Error updating leaderboard: {e}"
|
| 100 |
|
| 101 |
-
def timer_space_update(api: HfApi):
|
| 102 |
-
import threading
|
| 103 |
-
import time
|
| 104 |
-
|
| 105 |
-
thread = threading.Thread(target=lambda: time.sleep(2) and api.restart_space(REPO_ID))
|
| 106 |
-
thread.start()
|
| 107 |
-
thread.join()
|
| 108 |
|
| 109 |
def process_submission(file_path: str, metadata: Dict, version="v0") -> str:
|
| 110 |
"""
|
|
@@ -219,7 +212,6 @@ def process_submission(file_path: str, metadata: Dict, version="v0") -> str:
|
|
| 219 |
success, message = submit_leaderboard_to_hub(all_entries, version)
|
| 220 |
if not success:
|
| 221 |
return styled_error(message)
|
| 222 |
-
timer_space_update(api)
|
| 223 |
return styled_message(f"Submission successful! Model evaluated and leaderboard updated.")
|
| 224 |
|
| 225 |
except Exception as eval_error:
|
|
|
|
| 98 |
except Exception as e:
|
| 99 |
return False, f"Error updating leaderboard: {e}"
|
| 100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
|
| 102 |
def process_submission(file_path: str, metadata: Dict, version="v0") -> str:
|
| 103 |
"""
|
|
|
|
| 212 |
success, message = submit_leaderboard_to_hub(all_entries, version)
|
| 213 |
if not success:
|
| 214 |
return styled_error(message)
|
|
|
|
| 215 |
return styled_message(f"Submission successful! Model evaluated and leaderboard updated.")
|
| 216 |
|
| 217 |
except Exception as eval_error:
|