lewtun HF staff commited on
Commit
72d11c4
1 Parent(s): 9d5c632

Refactor app templates

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -49,8 +49,8 @@ TASK_TO_DEFAULT_METRICS = {
49
  ],
50
  "entity_extraction": ["precision", "recall", "f1", "accuracy"],
51
  "extractive_question_answering": [],
52
- "translation": ["sacrebleu", "gen_len"],
53
- "summarization": ["rouge1", "rouge2", "rougeL", "rougeLsum", "gen_len"],
54
  }
55
 
56
  SUPPORTED_TASKS = list(TASK_TO_ID.keys())
@@ -96,10 +96,11 @@ st.title("Evaluation as a Service")
96
  st.markdown(
97
  """
98
  Welcome to Hugging Face's Evaluation as a Service! This application allows
99
- you to evaluate 🤗 Transformers models with a dataset on the Hub. Please
100
- select the dataset and configuration below. The results of your evaluation
101
- will be displayed on the public leaderboard
102
- [here](https://huggingface.co/spaces/autoevaluate/leaderboards).
 
103
  """
104
  )
105
 
@@ -302,6 +303,7 @@ with st.expander("Advanced configuration"):
302
  col_mapping[answers_text_col] = "answers.text"
303
  col_mapping[answers_start_col] = "answers.answer_start"
304
 
 
305
  st.markdown("**Select metrics**")
306
  st.markdown("The following metrics will be computed")
307
  html_string = " ".join(
@@ -327,7 +329,6 @@ with st.expander("Advanced configuration"):
327
  with st.form(key="form"):
328
 
329
  compatible_models = get_compatible_models(selected_task, selected_dataset)
330
-
331
  selected_models = st.multiselect("Select the models you wish to evaluate", compatible_models)
332
  print("Selected models:", selected_models)
333
 
@@ -345,7 +346,7 @@ with st.form(key="form"):
345
 
346
  if submit_button:
347
  if len(selected_models) > 0:
348
- project_id = str(uuid.uuid4())
349
  payload = {
350
  "username": AUTOTRAIN_USERNAME,
351
  "proj_name": f"eval-project-{project_id}",
49
  ],
50
  "entity_extraction": ["precision", "recall", "f1", "accuracy"],
51
  "extractive_question_answering": [],
52
+ "translation": ["sacrebleu"],
53
+ "summarization": ["rouge1", "rouge2", "rougeL", "rougeLsum"],
54
  }
55
 
56
  SUPPORTED_TASKS = list(TASK_TO_ID.keys())
96
  st.markdown(
97
  """
98
  Welcome to Hugging Face's Evaluation as a Service! This application allows
99
+ you to evaluate [Transformers
100
+ models](https://huggingface.co/models?library=transformers&sort=downloads)
101
+ with a dataset on the Hub. Please select the dataset and configuration
102
+ below. The results of your evaluation will be displayed on the [public
103
+ leaderboard](https://huggingface.co/spaces/autoevaluate/leaderboards).
104
  """
105
  )
106
 
303
  col_mapping[answers_text_col] = "answers.text"
304
  col_mapping[answers_start_col] = "answers.answer_start"
305
 
306
+ # Select metrics
307
  st.markdown("**Select metrics**")
308
  st.markdown("The following metrics will be computed")
309
  html_string = " ".join(
329
  with st.form(key="form"):
330
 
331
  compatible_models = get_compatible_models(selected_task, selected_dataset)
 
332
  selected_models = st.multiselect("Select the models you wish to evaluate", compatible_models)
333
  print("Selected models:", selected_models)
334
 
346
 
347
  if submit_button:
348
  if len(selected_models) > 0:
349
+ project_id = str(uuid.uuid4())[:8]
350
  payload = {
351
  "username": AUTOTRAIN_USERNAME,
352
  "proj_name": f"eval-project-{project_id}",