Spaces:
AIR-Bench
/
Running on CPU Upgrade

nan commited on
Commit
f000c74
1 Parent(s): 8102fce

feat-rename-to-retrieval-methods-0520 (#11)

Browse files

- feat: disable model card check (070111910b2f23db4848f06bd2f46a2cbfdaea41)
- feat: rename retrieval models to retrieval methods (6013e065717473982257244b52943187295ee3e0)

Files changed (3) hide show
  1. app.py +6 -6
  2. src/display/utils.py +1 -1
  3. src/utils.py +0 -16
app.py CHANGED
@@ -122,10 +122,10 @@ with demo:
122
  )
123
  with gr.Row():
124
  search_bar = gr.Textbox(
125
- placeholder=" 🔍 Search for retrieval models (separate multiple queries with `;`) and press ENTER...",
126
  show_label=False,
127
  elem_id="search-bar",
128
- info="Search the retrieval models"
129
  )
130
  # select reranking model
131
  reranking_models = list(frozenset([eval_result.reranking_model for eval_result in raw_data]))
@@ -279,8 +279,8 @@ with demo:
279
  )
280
  with gr.Row():
281
  search_bar = gr.Textbox(
282
- info="Search the retrieval models",
283
- placeholder=" 🔍 Search for retrieval models (separate multiple queries with `;`) and press ENTER...",
284
  show_label=False,
285
  elem_id="search-bar-long-doc",
286
  )
@@ -435,9 +435,9 @@ with demo:
435
  gr.Markdown("## ✉️Submit your model here!", elem_classes="markdown-text")
436
  with gr.Row():
437
  with gr.Column():
438
- model_name = gr.Textbox(label="Retrieval Model name")
439
  with gr.Column():
440
- model_url = gr.Textbox(label="Retrieval Model URL")
441
  with gr.Row():
442
  with gr.Column():
443
  reranking_model_name = gr.Textbox(
 
122
  )
123
  with gr.Row():
124
  search_bar = gr.Textbox(
125
+ placeholder=" 🔍 Search for retrieval methods (separate multiple queries with `;`) and press ENTER...",
126
  show_label=False,
127
  elem_id="search-bar",
128
+ info="Search the retrieval methods"
129
  )
130
  # select reranking model
131
  reranking_models = list(frozenset([eval_result.reranking_model for eval_result in raw_data]))
 
279
  )
280
  with gr.Row():
281
  search_bar = gr.Textbox(
282
+ info="Search the retrieval methods",
283
+ placeholder=" 🔍 Search for retrieval methods (separate multiple queries with `;`) and press ENTER...",
284
  show_label=False,
285
  elem_id="search-bar-long-doc",
286
  )
 
435
  gr.Markdown("## ✉️Submit your model here!", elem_classes="markdown-text")
436
  with gr.Row():
437
  with gr.Column():
438
+ model_name = gr.Textbox(label="Retrieval Method name")
439
  with gr.Column():
440
+ model_url = gr.Textbox(label="Retrieval Method URL")
441
  with gr.Row():
442
  with gr.Column():
443
  reranking_model_name = gr.Textbox(
src/display/utils.py CHANGED
@@ -20,7 +20,7 @@ class ColumnContent:
20
 
21
 
22
  COL_NAME_AVG = "Average ⬆️"
23
- COL_NAME_RETRIEVAL_MODEL = "Retrieval Model"
24
  COL_NAME_RERANKING_MODEL = "Reranking Model"
25
  COL_NAME_RETRIEVAL_MODEL_LINK = "Retrieval Model LINK"
26
  COL_NAME_RERANKING_MODEL_LINK = "Reranking Model LINK"
 
20
 
21
 
22
  COL_NAME_AVG = "Average ⬆️"
23
+ COL_NAME_RETRIEVAL_MODEL = "Retrieval Method"
24
  COL_NAME_RERANKING_MODEL = "Reranking Model"
25
  COL_NAME_RETRIEVAL_MODEL_LINK = "Retrieval Model LINK"
26
  COL_NAME_RERANKING_MODEL_LINK = "Reranking Model LINK"
src/utils.py CHANGED
@@ -265,26 +265,10 @@ def submit_results(
265
  # TODO: retrieve the model page and find the model name on the page
266
  return styled_error(
267
  f"failed to submit. Model url must start with `https://` or `http://`. Illegal model url: {model_url}")
268
- if model_url.startswith("https://huggingface.co/"):
269
- # validate model card
270
- repo_id = model_url.removeprefix("https://huggingface.co/")
271
- try:
272
- card = ModelCard.load(repo_id)
273
- except EntryNotFoundError as e:
274
- return styled_error(
275
- f"failed to submit. Model url must be a link to a valid HuggingFace model on HuggingFace space. Could not get model {repo_id}")
276
  if reranking_model != "NoReranker":
277
  if not reranking_model_url.startswith("https://") and not reranking_model_url.startswith("http://"):
278
  return styled_error(
279
  f"failed to submit. Model url must start with `https://` or `http://`. Illegal model url: {model_url}")
280
- if reranking_model_url.startswith("https://huggingface.co/"):
281
- # validate model card
282
- repo_id = reranking_model_url.removeprefix("https://huggingface.co/")
283
- try:
284
- card = ModelCard.load(repo_id)
285
- except EntryNotFoundError as e:
286
- return styled_error(
287
- f"failed to submit. Model url must be a link to a valid HuggingFace model on HuggingFace space. Could not get model {repo_id}")
288
 
289
  # rename the uploaded file
290
  input_fp = Path(filepath)
 
265
  # TODO: retrieve the model page and find the model name on the page
266
  return styled_error(
267
  f"failed to submit. Model url must start with `https://` or `http://`. Illegal model url: {model_url}")
 
 
 
 
 
 
 
 
268
  if reranking_model != "NoReranker":
269
  if not reranking_model_url.startswith("https://") and not reranking_model_url.startswith("http://"):
270
  return styled_error(
271
  f"failed to submit. Model url must start with `https://` or `http://`. Illegal model url: {model_url}")
 
 
 
 
 
 
 
 
272
 
273
  # rename the uploaded file
274
  input_fp = Path(filepath)