sasha HF Staff commited on
Commit
afae9bc
·
verified ·
1 Parent(s): 445c657

Update app.py

Browse files

Removing `revision`

Files changed (1) hide show
  1. app.py +2 -17
app.py CHANGED
@@ -95,7 +95,6 @@ def get_model_size(model_info: ModelInfo, precision: str):
95
 
96
  def add_new_eval(
97
  repo_id: str,
98
- revision: str,
99
  precision: str,
100
  task: str,
101
  ):
@@ -105,17 +104,11 @@ def add_new_eval(
105
 
106
  current_time = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
107
 
108
-
109
- # Does the model actually exist?
110
- #if revision == "":
111
- revision = "main"
112
-
113
-
114
  # Is the model info correctly filled?
115
  try:
116
- model_info = API.model_info(repo_id=repo_id, revision=revision)
117
  except Exception:
118
- print("Could not find information for model %s at revision %s" % (model, revision))
119
  return
120
  # return styled_error("Could not get your model information. Please fill it up properly.")
121
 
@@ -136,7 +129,6 @@ def add_new_eval(
136
 
137
  request_dict = {
138
  "model": repo_id,
139
- "revision": revision,
140
  "precision": precision,
141
  "status": "PENDING",
142
  "submitted_time": current_time,
@@ -147,11 +139,6 @@ def add_new_eval(
147
  #"private": False,
148
  #}
149
 
150
- # Check for duplicate submission
151
- #if f"{model}_{revision}_{precision}" in REQUESTED_MODELS:
152
- # return styled_warning("This model has been already submitted.")
153
-
154
-
155
  out_file = f"{model_name}_eval_request_{precision}.json"
156
  temp_out_path = f"./temp/{REQUESTS_DATASET_PATH}/{model_owner}/"
157
  temp_out_file = f"./temp/{REQUESTS_DATASET_PATH}/{model_owner}/{out_file}"
@@ -189,7 +176,6 @@ with gr.Blocks() as demo:
189
  with gr.Row():
190
  with gr.Column():
191
  model_name_textbox = gr.Textbox(label="Model name", value="lvwerra/distilbert-imdb")
192
- revision_name_textbox = gr.Textbox(label="Revision commit", placeholder="main")
193
  task = gr.Dropdown(
194
  choices=tasks,
195
  label="Choose a benchmark task",
@@ -214,7 +200,6 @@ with gr.Blocks() as demo:
214
  fn=add_new_eval,
215
  inputs=[
216
  model_name_textbox,
217
- revision_name_textbox,
218
  precision,
219
  task,
220
  ],
 
95
 
96
  def add_new_eval(
97
  repo_id: str,
 
98
  precision: str,
99
  task: str,
100
  ):
 
104
 
105
  current_time = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
106
 
 
 
 
 
 
 
107
  # Is the model info correctly filled?
108
  try:
109
+ model_info = API.model_info(repo_id=repo_id)
110
  except Exception:
111
+ print("Could not find information for model %s" % (model))
112
  return
113
  # return styled_error("Could not get your model information. Please fill it up properly.")
114
 
 
129
 
130
  request_dict = {
131
  "model": repo_id,
 
132
  "precision": precision,
133
  "status": "PENDING",
134
  "submitted_time": current_time,
 
139
  #"private": False,
140
  #}
141
 
 
 
 
 
 
142
  out_file = f"{model_name}_eval_request_{precision}.json"
143
  temp_out_path = f"./temp/{REQUESTS_DATASET_PATH}/{model_owner}/"
144
  temp_out_file = f"./temp/{REQUESTS_DATASET_PATH}/{model_owner}/{out_file}"
 
176
  with gr.Row():
177
  with gr.Column():
178
  model_name_textbox = gr.Textbox(label="Model name", value="lvwerra/distilbert-imdb")
 
179
  task = gr.Dropdown(
180
  choices=tasks,
181
  label="Choose a benchmark task",
 
200
  fn=add_new_eval,
201
  inputs=[
202
  model_name_textbox,
 
203
  precision,
204
  task,
205
  ],