sasha HF Staff commited on
Commit
86ef244
·
verified ·
1 Parent(s): 681b3f6

Update app.py

Browse files

adding existing models

Files changed (1) hide show
  1. app.py +21 -2
app.py CHANGED
@@ -120,7 +120,7 @@ def add_new_eval(
120
  "precision": precision,
121
  "status": "PENDING",
122
  "submitted_time": current_time,
123
- "task": task.lower().replace(' ','_'),
124
  "likes": model_info.likes,
125
  "params": model_size}
126
  #"license": license,
@@ -152,6 +152,24 @@ def add_new_eval(
152
  print("Starting compute space at %s " % COMPUTE_SPACE)
153
  return start_compute_space()
154
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
 
156
 
157
 
@@ -191,5 +209,6 @@ with gr.Blocks() as demo:
191
  ],
192
  outputs=submission_result,
193
  )
194
-
 
195
  demo.launch()
 
120
  "precision": precision,
121
  "status": "PENDING",
122
  "submitted_time": current_time,
123
+ "task": task,
124
  "likes": model_info.likes,
125
  "params": model_size}
126
  #"license": license,
 
152
  print("Starting compute space at %s " % COMPUTE_SPACE)
153
  return start_compute_space()
154
 
155
+ def print_existing_models():
156
+ model_dict= []
157
+ requests_dataset = snapshot_download('EnergyStarAI/requests_debug', token=TOKEN, repo_type="dataset", allow_patterns="*.json")
158
+ for dir, path, files in os.walk(requests_dataset):
159
+ for fid in files:
160
+ file_path = os.path.join(dir, fid)
161
+ with open(file_path) as fp:
162
+ request = json.load(fp)
163
+ status = request['status']
164
+ if status == 'COMPLETE':
165
+ status = request['status']
166
+ model = request['model']
167
+ task = request['task']
168
+ model_dict.append([model, task])
169
+ return model_dict
170
+
171
+
172
+
173
 
174
 
175
 
 
209
  ],
210
  outputs=submission_result,
211
  )
212
+ with gr.Row():
213
+ gr.Dataframe(print_existing_models())
214
  demo.launch()