Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
refactor: remove the dependency in env
Browse files- app.py +3 -1
- src/benchmarks.py +6 -6
- src/envs.py +0 -4
app.py
CHANGED
|
@@ -19,10 +19,10 @@ from src.display.components import (
|
|
| 19 |
get_version_dropdown,
|
| 20 |
)
|
| 21 |
from src.display.css_html_js import custom_css
|
|
|
|
| 22 |
from src.envs import (
|
| 23 |
API,
|
| 24 |
BENCHMARK_VERSION_LIST,
|
| 25 |
-
BM25_LINK,
|
| 26 |
COL_NAME_RERANKING_MODEL,
|
| 27 |
COL_NAME_RETRIEVAL_MODEL,
|
| 28 |
DEFAULT_METRIC_LONG_DOC,
|
|
@@ -136,6 +136,8 @@ def update_doc_version(version):
|
|
| 136 |
|
| 137 |
demo = gr.Blocks(css=custom_css)
|
| 138 |
|
|
|
|
|
|
|
| 139 |
with demo:
|
| 140 |
gr.HTML(TITLE)
|
| 141 |
gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
|
|
|
|
| 19 |
get_version_dropdown,
|
| 20 |
)
|
| 21 |
from src.display.css_html_js import custom_css
|
| 22 |
+
from src.display.formatting import model_hyperlink
|
| 23 |
from src.envs import (
|
| 24 |
API,
|
| 25 |
BENCHMARK_VERSION_LIST,
|
|
|
|
| 26 |
COL_NAME_RERANKING_MODEL,
|
| 27 |
COL_NAME_RETRIEVAL_MODEL,
|
| 28 |
DEFAULT_METRIC_LONG_DOC,
|
|
|
|
| 136 |
|
| 137 |
demo = gr.Blocks(css=custom_css)
|
| 138 |
|
| 139 |
+
BM25_LINK = model_hyperlink("https://github.com/castorini/pyserini", "BM25")
|
| 140 |
+
|
| 141 |
with demo:
|
| 142 |
gr.HTML(TITLE)
|
| 143 |
gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
|
src/benchmarks.py
CHANGED
|
@@ -59,20 +59,20 @@ def get_benchmarks_enum(benchmark_version: str, task_type: TaskType):
|
|
| 59 |
return benchmark_dict
|
| 60 |
|
| 61 |
|
| 62 |
-
|
| 63 |
for version in BENCHMARK_VERSION_LIST:
|
| 64 |
safe_version_name = get_safe_name(version)[-4:]
|
| 65 |
-
|
| 66 |
f"QABenchmarks_{safe_version_name}", get_benchmarks_enum(version, TaskType.qa)
|
| 67 |
)
|
| 68 |
|
| 69 |
-
|
| 70 |
for version in BENCHMARK_VERSION_LIST:
|
| 71 |
safe_version_name = get_safe_name(version)[-4:]
|
| 72 |
-
|
| 73 |
f"LongDocBenchmarks_{safe_version_name}", get_benchmarks_enum(version, TaskType.long_doc)
|
| 74 |
)
|
| 75 |
|
| 76 |
|
| 77 |
-
QABenchmarks = Enum("QABenchmarks",
|
| 78 |
-
LongDocBenchmarks = Enum("LongDocBenchmarks",
|
|
|
|
| 59 |
return benchmark_dict
|
| 60 |
|
| 61 |
|
| 62 |
+
_qa_benchmark_dict = {}
|
| 63 |
for version in BENCHMARK_VERSION_LIST:
|
| 64 |
safe_version_name = get_safe_name(version)[-4:]
|
| 65 |
+
_qa_benchmark_dict[safe_version_name] = Enum(
|
| 66 |
f"QABenchmarks_{safe_version_name}", get_benchmarks_enum(version, TaskType.qa)
|
| 67 |
)
|
| 68 |
|
| 69 |
+
_doc_benchmark_dict = {}
|
| 70 |
for version in BENCHMARK_VERSION_LIST:
|
| 71 |
safe_version_name = get_safe_name(version)[-4:]
|
| 72 |
+
_doc_benchmark_dict[safe_version_name] = Enum(
|
| 73 |
f"LongDocBenchmarks_{safe_version_name}", get_benchmarks_enum(version, TaskType.long_doc)
|
| 74 |
)
|
| 75 |
|
| 76 |
|
| 77 |
+
QABenchmarks = Enum("QABenchmarks", _qa_benchmark_dict)
|
| 78 |
+
LongDocBenchmarks = Enum("LongDocBenchmarks", _doc_benchmark_dict)
|
src/envs.py
CHANGED
|
@@ -2,8 +2,6 @@ import os
|
|
| 2 |
|
| 3 |
from huggingface_hub import HfApi
|
| 4 |
|
| 5 |
-
from src.display.formatting import model_hyperlink
|
| 6 |
-
|
| 7 |
# Info to change for your repository
|
| 8 |
# ----------------------------------
|
| 9 |
TOKEN = os.environ.get("TOKEN", "") # A read/write token for your org
|
|
@@ -25,8 +23,6 @@ EVAL_RESULTS_PATH = os.path.join(CACHE_PATH, "eval_results")
|
|
| 25 |
|
| 26 |
API = HfApi(token=TOKEN)
|
| 27 |
|
| 28 |
-
BM25_LINK = model_hyperlink("https://github.com/castorini/pyserini", "BM25")
|
| 29 |
-
|
| 30 |
BENCHMARK_VERSION_LIST = [
|
| 31 |
"AIR-Bench_24.04",
|
| 32 |
"AIR-Bench_24.05",
|
|
|
|
| 2 |
|
| 3 |
from huggingface_hub import HfApi
|
| 4 |
|
|
|
|
|
|
|
| 5 |
# Info to change for your repository
|
| 6 |
# ----------------------------------
|
| 7 |
TOKEN = os.environ.get("TOKEN", "") # A read/write token for your org
|
|
|
|
| 23 |
|
| 24 |
API = HfApi(token=TOKEN)
|
| 25 |
|
|
|
|
|
|
|
| 26 |
BENCHMARK_VERSION_LIST = [
|
| 27 |
"AIR-Bench_24.04",
|
| 28 |
"AIR-Bench_24.05",
|