Spaces:
Runtime error
Runtime error
Update parse_requests.py
Browse files- parse_requests.py +7 -13
parse_requests.py
CHANGED
@@ -1,22 +1,16 @@
|
|
1 |
import os
|
2 |
-
from
|
3 |
-
import json
|
4 |
|
5 |
TOKEN = os.environ.get("DEBUG")
|
6 |
-
requests_dataset =
|
7 |
|
8 |
def normalize_task(task):
|
9 |
# Makes assumption about how the task names are being written, and called.
|
10 |
return '_'.join(task.split()).lower()
|
11 |
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
status = request['status']
|
19 |
-
if status == 'PENDING':
|
20 |
-
model = request['model']
|
21 |
-
task = normalize_task(request['task'])
|
22 |
-
print("%s,%s" % (model, task))
|
|
|
1 |
import os
|
2 |
+
from datasets import load_dataset, Dataset
|
|
|
3 |
|
4 |
TOKEN = os.environ.get("DEBUG")
|
5 |
+
requests_dataset = load_dataset("EnergyStarAI/requests_debug", split="test")
|
6 |
|
7 |
def normalize_task(task):
|
8 |
# Makes assumption about how the task names are being written, and called.
|
9 |
return '_'.join(task.split()).lower()
|
10 |
|
11 |
|
12 |
+
requests_dset = requests_dataset.to_pandas()
|
13 |
+
|
14 |
+
for model, task in requests_dset[['model','task']].loc[requests_dset['status'] == 'PENDING'].to_dict(orient= 'split', index=False)['data']:
|
15 |
+
print("%s,%s" % (model, normalize_task(task)))
|
16 |
+
|
|
|
|
|
|
|
|
|
|