meg-huggingface commited on
Commit
58b7eaf
·
1 Parent(s): 807b73e

Adding parser for request files

Browse files
Files changed (1) hide show
  1. parse_requests.py +15 -0
parse_requests.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from datasets import load_dataset
2
+
3
+
4
+ requests_dataset = load_dataset('EnergyStarAI/requests_debug')['test']
5
+
6
+ def normalize_task(task):
7
+ # Makes assumption about how the task names are being written, and called.
8
+ return '_'.join(task.split()).lower()
9
+
10
+ for request in requests_dataset:
11
+ status = request['status']
12
+ if status == 'PENDING':
13
+ model = request['model']
14
+ task = normalize_task(request['task'])
15
+ print("%s,%s" % (model, task))