Spaces:
				
			
			
	
			
			
		Runtime error
		
	
	
	
			
			
	
	
	
	
		
		
		Runtime error
		
	Update README.md
Browse files- leaderboard/README.md +121 -0
 
    	
        leaderboard/README.md
    CHANGED
    
    | 
         @@ -1,3 +1,14 @@ 
     | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 1 | 
         
             
            # Transformers.js Benchmark Leaderboard
         
     | 
| 2 | 
         | 
| 3 | 
         
             
            A Gradio-based leaderboard that displays benchmark results from a HuggingFace Dataset repository.
         
     | 
| 
         @@ -74,9 +85,119 @@ The leaderboard reads JSONL files from the HuggingFace Dataset repository. Each 
     | 
|
| 74 | 
         
             
            }
         
     | 
| 75 | 
         
             
            ```
         
     | 
| 76 | 
         | 
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 77 | 
         
             
            ## Development
         
     | 
| 78 | 
         | 
| 79 | 
         
             
            The leaderboard is built with:
         
     | 
| 80 | 
         
             
            - **Gradio**: Web UI framework
         
     | 
| 81 | 
         
             
            - **Pandas**: Data manipulation
         
     | 
| 82 | 
         
             
            - **HuggingFace Hub**: Dataset loading
         
     | 
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
| 
         | 
|
| 1 | 
         
            +
            ---
         
     | 
| 2 | 
         
            +
            title: Transformers.js Benchmark Leaderboard
         
     | 
| 3 | 
         
            +
            emoji: π
         
     | 
| 4 | 
         
            +
            colorFrom: blue
         
     | 
| 5 | 
         
            +
            colorTo: purple
         
     | 
| 6 | 
         
            +
            sdk: gradio
         
     | 
| 7 | 
         
            +
            sdk_version: 5.49.1
         
     | 
| 8 | 
         
            +
            app_file: src/leaderboard/app.py
         
     | 
| 9 | 
         
            +
            pinned: false
         
     | 
| 10 | 
         
            +
            ---
         
     | 
| 11 | 
         
            +
             
     | 
| 12 | 
         
             
            # Transformers.js Benchmark Leaderboard
         
     | 
| 13 | 
         | 
| 14 | 
         
             
            A Gradio-based leaderboard that displays benchmark results from a HuggingFace Dataset repository.
         
     | 
| 
         | 
|
| 85 | 
         
             
            }
         
     | 
| 86 | 
         
             
            ```
         
     | 
| 87 | 
         | 
| 88 | 
         
            +
            ## Deployment on Hugging Face Spaces
         
     | 
| 89 | 
         
            +
             
     | 
| 90 | 
         
            +
            This leaderboard is designed to be deployed on [Hugging Face Spaces](https://huggingface.co/spaces) using the Gradio SDK.
         
     | 
| 91 | 
         
            +
             
     | 
| 92 | 
         
            +
            ### Quick Deploy
         
     | 
| 93 | 
         
            +
             
     | 
| 94 | 
         
            +
            1. **Create a new Space** on Hugging Face:
         
     | 
| 95 | 
         
            +
               - Go to https://huggingface.co/new-space
         
     | 
| 96 | 
         
            +
               - Choose **Gradio** as the SDK
         
     | 
| 97 | 
         
            +
               - Set the Space name (e.g., `transformersjs-benchmark-leaderboard`)
         
     | 
| 98 | 
         
            +
             
     | 
| 99 | 
         
            +
            2. **Upload files to your Space**:
         
     | 
| 100 | 
         
            +
               ```bash
         
     | 
| 101 | 
         
            +
               # Clone your Space repository
         
     | 
| 102 | 
         
            +
               git clone https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME
         
     | 
| 103 | 
         
            +
               cd YOUR_SPACE_NAME
         
     | 
| 104 | 
         
            +
             
     | 
| 105 | 
         
            +
               # Copy leaderboard files
         
     | 
| 106 | 
         
            +
               cp -r /path/to/leaderboard/* .
         
     | 
| 107 | 
         
            +
             
     | 
| 108 | 
         
            +
               # Commit and push
         
     | 
| 109 | 
         
            +
               git add .
         
     | 
| 110 | 
         
            +
               git commit -m "Initial leaderboard deployment"
         
     | 
| 111 | 
         
            +
               git push
         
     | 
| 112 | 
         
            +
               ```
         
     | 
| 113 | 
         
            +
             
     | 
| 114 | 
         
            +
            3. **Configure Space secrets**:
         
     | 
| 115 | 
         
            +
               - Go to your Space settings β **Variables and secrets**
         
     | 
| 116 | 
         
            +
               - Add the following secrets:
         
     | 
| 117 | 
         
            +
                 - `HF_DATASET_REPO`: Your dataset repository (e.g., `username/benchmark-results`)
         
     | 
| 118 | 
         
            +
                 - `HF_TOKEN`: Your HuggingFace API token (for private datasets)
         
     | 
| 119 | 
         
            +
             
     | 
| 120 | 
         
            +
            4. **Space will automatically deploy** and be available at:
         
     | 
| 121 | 
         
            +
               ```
         
     | 
| 122 | 
         
            +
               https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME
         
     | 
| 123 | 
         
            +
               ```
         
     | 
| 124 | 
         
            +
             
     | 
| 125 | 
         
            +
            ### Space Configuration
         
     | 
| 126 | 
         
            +
             
     | 
| 127 | 
         
            +
            The Space is configured via the YAML frontmatter in `README.md`:
         
     | 
| 128 | 
         
            +
             
     | 
| 129 | 
         
            +
            ```yaml
         
     | 
| 130 | 
         
            +
            ---
         
     | 
| 131 | 
         
            +
            title: Transformers.js Benchmark Leaderboard
         
     | 
| 132 | 
         
            +
            emoji: π
         
     | 
| 133 | 
         
            +
            colorFrom: blue
         
     | 
| 134 | 
         
            +
            colorTo: purple
         
     | 
| 135 | 
         
            +
            sdk: gradio
         
     | 
| 136 | 
         
            +
            sdk_version: 5.49.1
         
     | 
| 137 | 
         
            +
            app_file: src/leaderboard/app.py
         
     | 
| 138 | 
         
            +
            pinned: false
         
     | 
| 139 | 
         
            +
            ---
         
     | 
| 140 | 
         
            +
            ```
         
     | 
| 141 | 
         
            +
             
     | 
| 142 | 
         
            +
            **Key configuration options:**
         
     | 
| 143 | 
         
            +
            - `sdk`: Must be `gradio` for Gradio apps
         
     | 
| 144 | 
         
            +
            - `sdk_version`: Gradio version (matches your `pyproject.toml`)
         
     | 
| 145 | 
         
            +
            - `app_file`: Path to the main Python file (relative to repository root)
         
     | 
| 146 | 
         
            +
            - `pinned`: Set to `true` to pin the Space on your profile
         
     | 
| 147 | 
         
            +
             
     | 
| 148 | 
         
            +
            ### Requirements
         
     | 
| 149 | 
         
            +
             
     | 
| 150 | 
         
            +
            The Space will automatically install dependencies from `pyproject.toml`:
         
     | 
| 151 | 
         
            +
            - `gradio>=5.9.1`
         
     | 
| 152 | 
         
            +
            - `pandas`
         
     | 
| 153 | 
         
            +
            - `huggingface-hub`
         
     | 
| 154 | 
         
            +
            - `python-dotenv`
         
     | 
| 155 | 
         
            +
             
     | 
| 156 | 
         
            +
            ### Environment Variables
         
     | 
| 157 | 
         
            +
             
     | 
| 158 | 
         
            +
            Set these in your Space settings or in a `.env` file (not recommended for production):
         
     | 
| 159 | 
         
            +
             
     | 
| 160 | 
         
            +
            | Variable | Required | Description |
         
     | 
| 161 | 
         
            +
            |----------|----------|-------------|
         
     | 
| 162 | 
         
            +
            | `HF_DATASET_REPO` | Yes | HuggingFace dataset repository containing benchmark results |
         
     | 
| 163 | 
         
            +
            | `HF_TOKEN` | No | HuggingFace API token (only for private datasets) |
         
     | 
| 164 | 
         
            +
             
     | 
| 165 | 
         
            +
            ### Auto-Restart
         
     | 
| 166 | 
         
            +
             
     | 
| 167 | 
         
            +
            Spaces automatically restart when:
         
     | 
| 168 | 
         
            +
            - Code is pushed to the repository
         
     | 
| 169 | 
         
            +
            - Dependencies are updated
         
     | 
| 170 | 
         
            +
            - Environment variables are changed
         
     | 
| 171 | 
         
            +
             
     | 
| 172 | 
         
            +
            ### Monitoring
         
     | 
| 173 | 
         
            +
             
     | 
| 174 | 
         
            +
            - View logs in the Space's **Logs** tab
         
     | 
| 175 | 
         
            +
            - Check status in the **Settings** tab
         
     | 
| 176 | 
         
            +
            - Monitor resource usage (CPU, memory)
         
     | 
| 177 | 
         
            +
             
     | 
| 178 | 
         
             
            ## Development
         
     | 
| 179 | 
         | 
| 180 | 
         
             
            The leaderboard is built with:
         
     | 
| 181 | 
         
             
            - **Gradio**: Web UI framework
         
     | 
| 182 | 
         
             
            - **Pandas**: Data manipulation
         
     | 
| 183 | 
         
             
            - **HuggingFace Hub**: Dataset loading
         
     | 
| 184 | 
         
            +
             
     | 
| 185 | 
         
            +
            ### Local Development
         
     | 
| 186 | 
         
            +
             
     | 
| 187 | 
         
            +
            1. Install dependencies:
         
     | 
| 188 | 
         
            +
               ```bash
         
     | 
| 189 | 
         
            +
               uv sync
         
     | 
| 190 | 
         
            +
               ```
         
     | 
| 191 | 
         
            +
             
     | 
| 192 | 
         
            +
            2. Set environment variables:
         
     | 
| 193 | 
         
            +
               ```bash
         
     | 
| 194 | 
         
            +
               export HF_DATASET_REPO="your-username/benchmark-results"
         
     | 
| 195 | 
         
            +
               export HF_TOKEN="your-hf-token"  # Optional
         
     | 
| 196 | 
         
            +
               ```
         
     | 
| 197 | 
         
            +
             
     | 
| 198 | 
         
            +
            3. Run locally:
         
     | 
| 199 | 
         
            +
               ```bash
         
     | 
| 200 | 
         
            +
               uv run python -m leaderboard.app
         
     | 
| 201 | 
         
            +
               ```
         
     | 
| 202 | 
         
            +
             
     | 
| 203 | 
         
            +
            4. Access at: http://localhost:7861
         
     |