Spaces:
Running
Running
Use safe list
Browse files- requirements.txt +1 -1
- src/submissions.py +2 -2
- src/wandb_data.py +15 -4
requirements.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
fiber @ git+https://github.com/rayonlabs/fiber.git@2.
|
2 |
gradio==5.11.0
|
3 |
wandb==0.19.2
|
4 |
substrate-interface==1.7.10
|
|
|
1 |
+
fiber @ git+https://github.com/rayonlabs/fiber.git@2.1.1#egg=fiber[chain]
|
2 |
gradio==5.11.0
|
3 |
wandb==0.19.2
|
4 |
substrate-interface==1.7.10
|
src/submissions.py
CHANGED
@@ -22,9 +22,9 @@ class SubmissionStatus(Enum):
|
|
22 |
if hotkey in blacklisted_keys.hotkeys or coldkey in blacklisted_keys.coldkeys:
|
23 |
return SubmissionStatus.BLACKLISTED
|
24 |
|
25 |
-
if any(
|
26 |
submission.hotkey == hotkey and submission.revision == revision
|
27 |
-
for submission in blacklisted_keys.
|
28 |
):
|
29 |
return SubmissionStatus.DUPLICATE
|
30 |
|
|
|
22 |
if hotkey in blacklisted_keys.hotkeys or coldkey in blacklisted_keys.coldkeys:
|
23 |
return SubmissionStatus.BLACKLISTED
|
24 |
|
25 |
+
if not any(
|
26 |
submission.hotkey == hotkey and submission.revision == revision
|
27 |
+
for submission in blacklisted_keys.duplicate_selection.safe_submissions
|
28 |
):
|
29 |
return SubmissionStatus.DUPLICATE
|
30 |
|
src/wandb_data.py
CHANGED
@@ -27,12 +27,23 @@ class DuplicateSubmission(BaseModel):
|
|
27 |
hotkey: Key
|
28 |
url: str
|
29 |
revision: str
|
30 |
-
copy_of:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
class Blacklist(BaseModel):
|
33 |
coldkeys: set[Key]
|
34 |
hotkeys: set[Key]
|
35 |
-
|
36 |
|
37 |
|
38 |
class BenchmarkStatus(Enum):
|
@@ -291,12 +302,12 @@ def get_blacklisted_keys() -> Blacklist:
|
|
291 |
response = requests.get(DUPLICATE_SUBMISSIONS_ENDPOINT)
|
292 |
response.raise_for_status()
|
293 |
|
294 |
-
|
295 |
|
296 |
return Blacklist(
|
297 |
hotkeys=blacklist_hotkeys,
|
298 |
coldkeys=blacklist_coldkeys,
|
299 |
-
|
300 |
)
|
301 |
|
302 |
|
|
|
27 |
hotkey: Key
|
28 |
url: str
|
29 |
revision: str
|
30 |
+
copy_of: str
|
31 |
+
|
32 |
+
|
33 |
+
class SafeSubmissions(BaseModel):
|
34 |
+
hotkey: Key
|
35 |
+
url: str
|
36 |
+
revision: str
|
37 |
+
|
38 |
+
|
39 |
+
class DuplicateSelection(BaseModel):
|
40 |
+
safe_submissions: list[SafeSubmissions]
|
41 |
+
duplicate_submissions: list[DuplicateSubmission]
|
42 |
|
43 |
class Blacklist(BaseModel):
|
44 |
coldkeys: set[Key]
|
45 |
hotkeys: set[Key]
|
46 |
+
duplicate_selection: DuplicateSelection
|
47 |
|
48 |
|
49 |
class BenchmarkStatus(Enum):
|
|
|
302 |
response = requests.get(DUPLICATE_SUBMISSIONS_ENDPOINT)
|
303 |
response.raise_for_status()
|
304 |
|
305 |
+
duplicate_selection = DuplicateSelection.model_validate(response.json())
|
306 |
|
307 |
return Blacklist(
|
308 |
hotkeys=blacklist_hotkeys,
|
309 |
coldkeys=blacklist_coldkeys,
|
310 |
+
duplicate_selection=duplicate_selection
|
311 |
)
|
312 |
|
313 |
|