Spaces:
Running
Running
Commit
·
c36279d
1
Parent(s):
7511bc7
Add blacklist checkbox
Browse files- src/app.py +6 -2
- src/submissions.py +5 -1
src/app.py
CHANGED
@@ -37,9 +37,13 @@ def main():
|
|
37 |
include_inactive_checkbox.change(lambda include_inactive: create_weights(include_inactive), [include_inactive_checkbox], [validator_weights_dataframe])
|
38 |
|
39 |
with gr.Tab("Submissions") as submissions_tab:
|
|
|
|
|
40 |
submissions_dataframe = gr.Dataframe()
|
41 |
-
submissions_dataframe.attach_load_event(lambda: create_submissions(), None)
|
42 |
-
submissions_tab.select(lambda: create_submissions(), [], [submissions_dataframe])
|
|
|
|
|
43 |
|
44 |
with gr.Tab("Model Demo"):
|
45 |
create_demo()
|
|
|
37 |
include_inactive_checkbox.change(lambda include_inactive: create_weights(include_inactive), [include_inactive_checkbox], [validator_weights_dataframe])
|
38 |
|
39 |
with gr.Tab("Submissions") as submissions_tab:
|
40 |
+
include_blacklisted_checkbox = gr.Checkbox(False, label="Include Blacklisted", container=False, )
|
41 |
+
|
42 |
submissions_dataframe = gr.Dataframe()
|
43 |
+
submissions_dataframe.attach_load_event(lambda include_blacklisted: create_submissions(include_blacklisted), None, [include_blacklisted_checkbox])
|
44 |
+
submissions_tab.select(lambda include_blacklisted: create_submissions(include_blacklisted), [include_blacklisted_checkbox], [submissions_dataframe])
|
45 |
+
|
46 |
+
include_blacklisted_checkbox.change(lambda include_blacklisted: create_submissions(include_blacklisted), [include_blacklisted_checkbox], [submissions_dataframe])
|
47 |
|
48 |
with gr.Tab("Model Demo"):
|
49 |
create_demo()
|
src/submissions.py
CHANGED
@@ -22,13 +22,17 @@ def get_status(run: Run, hotkey: Key, coldkey: Key, block: int) -> tuple[str, st
|
|
22 |
return "Pending", "orange"
|
23 |
|
24 |
|
25 |
-
def create_submissions() -> gr.Dataframe:
|
26 |
data: list[list] = []
|
27 |
sync_metagraph()
|
28 |
runs = sorted(get_current_runs(), key=lambda run: run.uid)
|
29 |
|
30 |
for hotkey, commitment in COMMITMENTS.items():
|
31 |
coldkey = metagraph.nodes[hotkey].coldkey
|
|
|
|
|
|
|
|
|
32 |
row = [
|
33 |
UIDS_BY_HOTKEY[hotkey],
|
34 |
f"[{'/'.join(commitment.get_repo_link().split('/')[-2:])}]({commitment.get_repo_link()})",
|
|
|
22 |
return "Pending", "orange"
|
23 |
|
24 |
|
25 |
+
def create_submissions(include_blacklisted: bool) -> gr.Dataframe:
|
26 |
data: list[list] = []
|
27 |
sync_metagraph()
|
28 |
runs = sorted(get_current_runs(), key=lambda run: run.uid)
|
29 |
|
30 |
for hotkey, commitment in COMMITMENTS.items():
|
31 |
coldkey = metagraph.nodes[hotkey].coldkey
|
32 |
+
|
33 |
+
if not include_blacklisted and (hotkey in BLACKLISTED_HOTKEYS or coldkey in BLACKLISTED_COLDKEYS):
|
34 |
+
continue
|
35 |
+
|
36 |
row = [
|
37 |
UIDS_BY_HOTKEY[hotkey],
|
38 |
f"[{'/'.join(commitment.get_repo_link().split('/')[-2:])}]({commitment.get_repo_link()})",
|