AMR-KELEG commited on
Commit
b85527f
·
1 Parent(s): fa481ab

Tweaks for the leaderboard

Browse files
Files changed (2) hide show
  1. app.py +9 -3
  2. background_inference.py +6 -2
app.py CHANGED
@@ -95,8 +95,12 @@ with tab1:
95
  results_df["Rank"] = range(1, len(results_df) + 1)
96
  results_df["URL"] = [
97
  f"https://huggingface.co/{row['model_name']}"
 
 
 
 
 
98
  for row in model_predictions_rows
99
- if row["status"] == "completed"
100
  ]
101
  results_df["Commit ID"] = [
102
  row["commit_id"][:5]
@@ -213,7 +217,7 @@ with tab1:
213
  row["inference_function"],
214
  ]
215
  )
216
- print(f"Started evaluating of {row['model_name']}.")
217
 
218
  with tab2:
219
  model_name = st.text_input("Enter a model's name on HF")
@@ -281,4 +285,6 @@ with tab2:
281
  )
282
 
283
  else:
284
- st.info(f"The model {model_name} is already submitted the leaderboard.")
 
 
 
95
  results_df["Rank"] = range(1, len(results_df) + 1)
96
  results_df["URL"] = [
97
  f"https://huggingface.co/{row['model_name']}"
98
+ if (
99
+ row["status"] == "completed"
100
+ and "shared task team" not in row["model_name"]
101
+ )
102
+ else "N/A"
103
  for row in model_predictions_rows
 
104
  ]
105
  results_df["Commit ID"] = [
106
  row["commit_id"][:5]
 
217
  row["inference_function"],
218
  ]
219
  )
220
+ print(f"Started the evaluation of {row['model_name']}.")
221
 
222
  with tab2:
223
  model_name = st.text_input("Enter a model's name on HF")
 
285
  )
286
 
287
  else:
288
+ st.info(
289
+ f"The model {model_name} has already submitted to the leaderboard before."
290
+ )
background_inference.py CHANGED
@@ -4,7 +4,11 @@ import utils
4
  import datasets
5
  import eval_utils
6
  from constants import DIALECTS_WITH_LABELS
7
- from transformers import AutoTokenizer, AutoModel, AutoModelForSequenceClassification
 
 
 
 
8
  from huggingface_hub import login
9
 
10
  access_token = os.environ["HF_TOKEN"]
@@ -25,7 +29,7 @@ utils.update_model_queue(
25
  try:
26
  tokenizer = AutoTokenizer.from_pretrained(model_name, revision=commit_id)
27
  if inference_function == "prompt_chat_LLM":
28
- model = AutoModel.from_pretrained(model_name, revision=commit_id)
29
  else:
30
  model = AutoModelForSequenceClassification.from_pretrained(
31
  model_name, revision=commit_id
 
4
  import datasets
5
  import eval_utils
6
  from constants import DIALECTS_WITH_LABELS
7
+ from transformers import (
8
+ AutoTokenizer,
9
+ AutoModelForCausalLM,
10
+ AutoModelForSequenceClassification,
11
+ )
12
  from huggingface_hub import login
13
 
14
  access_token = os.environ["HF_TOKEN"]
 
29
  try:
30
  tokenizer = AutoTokenizer.from_pretrained(model_name, revision=commit_id)
31
  if inference_function == "prompt_chat_LLM":
32
+ model = AutoModelForCausalLM.from_pretrained(model_name, revision=commit_id)
33
  else:
34
  model = AutoModelForSequenceClassification.from_pretrained(
35
  model_name, revision=commit_id