Spaces:
Running
Running
update readme and server .env references
Browse files- README.md +10 -1
- server/server.py +4 -3
README.md
CHANGED
@@ -25,6 +25,10 @@ An application to explore and discover all leaderboards from the Hugging Face co
|
|
25 |
- π Dark/Light mode
|
26 |
- π Automatic data updates
|
27 |
|
|
|
|
|
|
|
|
|
28 |
## Configuration
|
29 |
|
30 |
### Environment Variables
|
@@ -35,13 +39,18 @@ Create a `.env` file in the server directory with the following variables:
|
|
35 |
# Hugging Face API token (required)
|
36 |
HF_TOKEN=your_token_here
|
37 |
|
38 |
-
#
|
|
|
|
|
|
|
39 |
API_HOST=0.0.0.0
|
40 |
API_PORT=3002
|
41 |
```
|
42 |
|
43 |
The `HF_TOKEN` is required to access private datasets on Hugging Face. You can get your token from your [Hugging Face account settings](https://huggingface.co/settings/tokens).
|
44 |
|
|
|
|
|
45 |
## Local Development
|
46 |
|
47 |
1. Install client dependencies:
|
|
|
25 |
- π Dark/Light mode
|
26 |
- π Automatic data updates
|
27 |
|
28 |
+
## Data Source
|
29 |
+
|
30 |
+
The application fetches data from the [leaderboard-explorer/leaderboard_explorer](https://huggingface.co/datasets/leaderboard-explorer/leaderboard_explorer) dataset on Hugging Face Hub. This dataset contains the consolidated leaderboard data in the `final_leaderboards.json` file.
|
31 |
+
|
32 |
## Configuration
|
33 |
|
34 |
### Environment Variables
|
|
|
39 |
# Hugging Face API token (required)
|
40 |
HF_TOKEN=your_token_here
|
41 |
|
42 |
+
# Hugging Face dataset repository ID
|
43 |
+
HF_REPO_ID=OpenEvals/find-a-leaderboard
|
44 |
+
|
45 |
+
# Server configuration
|
46 |
API_HOST=0.0.0.0
|
47 |
API_PORT=3002
|
48 |
```
|
49 |
|
50 |
The `HF_TOKEN` is required to access private datasets on Hugging Face. You can get your token from your [Hugging Face account settings](https://huggingface.co/settings/tokens).
|
51 |
|
52 |
+
The `HF_REPO_ID` specifies which dataset repository to use. By default, it points to the main leaderboard explorer dataset.
|
53 |
+
|
54 |
## Local Development
|
55 |
|
56 |
1. Install client dependencies:
|
server/server.py
CHANGED
@@ -16,7 +16,8 @@ load_dotenv()
|
|
16 |
# API configuration
|
17 |
API_HOST = os.getenv("API_HOST", "0.0.0.0")
|
18 |
API_PORT = int(os.getenv("API_PORT", "3002"))
|
19 |
-
|
|
|
20 |
CACHE_DIR = "cache"
|
21 |
CACHE_DURATION = timedelta(seconds=10)
|
22 |
|
@@ -71,9 +72,9 @@ async def get_leaderboards():
|
|
71 |
|
72 |
# If no cache or expired, download from HF
|
73 |
file_path = hf_hub_download(
|
74 |
-
repo_id=
|
75 |
filename="final_leaderboards.json",
|
76 |
-
token=
|
77 |
repo_type="dataset"
|
78 |
)
|
79 |
|
|
|
16 |
# API configuration
|
17 |
API_HOST = os.getenv("API_HOST", "0.0.0.0")
|
18 |
API_PORT = int(os.getenv("API_PORT", "3002"))
|
19 |
+
HUGGING_FACE_HUB_TOKEN = os.getenv("HUGGING_FACE_HUB_TOKEN")
|
20 |
+
HUGGING_FACE_STORAGE_REPO = os.getenv("HUGGING_FACE_STORAGE_REPO")
|
21 |
CACHE_DIR = "cache"
|
22 |
CACHE_DURATION = timedelta(seconds=10)
|
23 |
|
|
|
72 |
|
73 |
# If no cache or expired, download from HF
|
74 |
file_path = hf_hub_download(
|
75 |
+
repo_id=HUGGING_FACE_STORAGE_REPO,
|
76 |
filename="final_leaderboards.json",
|
77 |
+
token=HUGGING_FACE_HUB_TOKEN,
|
78 |
repo_type="dataset"
|
79 |
)
|
80 |
|