Fhrozen commited on
Commit
9241ec3
·
1 Parent(s): fc68877
app.py CHANGED
@@ -43,10 +43,6 @@ def create_app():
43
 
44
  # Create tabs for different tasks
45
  with gr.Tabs():
46
-
47
- with gr.Tab("All Tasks"):
48
- create_leaderboard_tab("All Tasks", leaderboard_data, rows_per_page=30)
49
-
50
  with gr.Tab("Speech Recognition"):
51
  create_leaderboard_tab("Speech Recognition", leaderboard_data, rows_per_page=30)
52
 
@@ -62,28 +58,6 @@ def create_app():
62
  with gr.Tab("Request a model"):
63
  create_submit_tab()
64
 
65
- with gr.Tab("About"):
66
- gr.Markdown("""
67
- ## About ESPnet Leaderboard
68
-
69
- This leaderboard is powered by the ESPnet toolkit, an end-to-end speech processing toolkit.
70
-
71
- ### How to Submit
72
-
73
- To submit your model results:
74
- 1. Prepare your results in the required format
75
- 2. Submit via the **Request a model** tab
76
- 3. Results will be automatically updated on the leaderboard
77
-
78
- ### Data Sources
79
-
80
- All data is loaded from Hugging Face datasets and updated regularly.
81
-
82
- ### Contact
83
-
84
- For questions or issues, please visit: [ESPnet GitHub](https://github.com/espnet/espnet)
85
- """)
86
-
87
  # Footer
88
  gr.HTML("""
89
  <div class="footer-text">
 
43
 
44
  # Create tabs for different tasks
45
  with gr.Tabs():
 
 
 
 
46
  with gr.Tab("Speech Recognition"):
47
  create_leaderboard_tab("Speech Recognition", leaderboard_data, rows_per_page=30)
48
 
 
58
  with gr.Tab("Request a model"):
59
  create_submit_tab()
60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  # Footer
62
  gr.HTML("""
63
  <div class="footer-text">
espnet_leaderboard/display/css_html_js.py CHANGED
@@ -24,6 +24,25 @@ CUSTOM_CSS = """
24
  overflow: hidden;
25
  }
26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  /* Table styling */
28
  .dataframe {
29
  border-collapse: collapse !important;
 
24
  overflow: hidden;
25
  }
26
 
27
+ /* Leaderboard tab container */
28
+ .leaderboard-tab-container {
29
+ max-height: calc(100vh - 250px);
30
+ overflow-y: auto;
31
+ overflow-x: hidden;
32
+ padding-right: 10px;
33
+ }
34
+
35
+ /* Dataframe container */
36
+ .dataframe-container {
37
+ max-height: 650px;
38
+ overflow-y: auto;
39
+ overflow-x: auto;
40
+ margin: 10px 0;
41
+ border: 1px solid #e0e0e0;
42
+ border-radius: 8px;
43
+ padding: 5px;
44
+ }
45
+
46
  /* Table styling */
47
  .dataframe {
48
  border-collapse: collapse !important;
espnet_leaderboard/display/tabs.py CHANGED
@@ -111,7 +111,6 @@ def create_leaderboard_tab(
111
 
112
 
113
  def create_submit_tab():
114
- gr.Markdown("## Request a model here!")
115
  def _submit_model(model_text):
116
  if (model_text is None) or len(model_text) < 1:
117
  return model_text
@@ -139,109 +138,46 @@ def create_submit_tab():
139
  )
140
  return ""
141
 
142
- def _check_custom_file(json_file):
143
- # Check if file is None or empty
144
- if json_file is None:
145
- return
146
-
147
- # Get the file path
148
- file_path = json_file.name if hasattr(json_file, 'name') else str(json_file)
149
-
150
- # Check if the file has .json extension
151
- if not file_path.lower().endswith('.json'):
152
- gr.Warning(
153
- "Invalid file format. Please upload a JSON file with .json extension."
154
- )
155
- return
156
-
157
- # Try to validate JSON content
158
- try:
159
- with open(file_path, 'r') as f:
160
- json_content = json.load(f)
161
- gr.Info(
162
- f"JSON file <b>{file_path.split('/')[-1]}</b> uploaded successfully.<br/>"
163
- "File is being validated."
164
- )
165
- # Return None to clear the file component after successful upload
166
- return json_file
167
- except json.JSONDecodeError as e:
168
- gr.Warning(
169
- f"Invalid JSON format: {str(e)}"
170
  )
171
- return
172
- except Exception as e:
173
- gr.Warning(
174
- f"Error reading file: {str(e)}"
 
 
 
175
  )
176
- return
 
 
 
177
 
178
- def _submit_custom(json_file):
179
- if json_file is None:
180
- return json_file
181
 
182
- with open(json_file, "r", encoding="utf-8") as reader:
183
- # Here the content is loaded as string to be saved in the database.
184
- content = reader.read()
185
- gr.Info(
186
- f"Custom results <b>{json_file}</b> submitted.<br/>"
187
- "Thank you for your submission."
188
- )
189
- return
190
-
191
- with gr.Tabs():
192
- with gr.Tab("From Huggingface Hub"):
193
- with gr.Row():
194
- with gr.Column(scale=1):
195
- model_box = gr.Textbox(
196
- label="Model name",
197
- placeholder="Repository in format: ''user_name/model_name''",
198
- scale=3,
199
- max_lines=1,
200
- )
201
- with gr.Column(scale=1):
202
- pass
203
-
204
- with gr.Row():
205
- with gr.Column(scale=1):
206
- submit_model_btn = gr.Button("Submit ✉️")
207
- with gr.Column(scale=2):
208
- pass
209
-
210
- with gr.Tab("From Custom results"):
211
- gr.Markdown("Submit your results in JSON format here: ")
212
- gr.Markdown("The file needs to have the fields detailed [here](https://github.com/espnet/espnet).")
213
- with gr.Row():
214
- with gr.Column(scale=2):
215
- custom_file = gr.File(file_types=[".json"])
216
- with gr.Row():
217
- with gr.Column():
218
- upload_button = gr.UploadButton(
219
- label="Upload JSON File",
220
- file_types=[".json"],
221
- file_count="single",
222
- )
223
- with gr.Column():
224
- submit_custom_button = gr.Button(
225
- "Submit ✉️"
226
- )
227
- with gr.Column(scale=1):
228
- pass
229
-
230
 
231
  submit_model_btn.click(
232
  fn=_submit_model,
233
  inputs=[model_box],
234
  outputs=[model_box]
235
  )
236
- submit_custom_button.click(
237
- fn=_submit_custom,
238
- inputs=[custom_file],
239
- outputs=[custom_file]
240
- )
241
- upload_button.upload(
242
- fn=_check_custom_file,
243
- inputs=[upload_button],
244
- outputs=[custom_file]
245
- )
246
-
247
  return
 
111
 
112
 
113
  def create_submit_tab():
 
114
  def _submit_model(model_text):
115
  if (model_text is None) or len(model_text) < 1:
116
  return model_text
 
138
  )
139
  return ""
140
 
141
+ with gr.Column():
142
+ gr.Markdown("## Request a model here!")
143
+
144
+ with gr.Row():
145
+ with gr.Column(scale=1):
146
+ gr.Markdown(
147
+ """### How to Submit
148
+
149
+ To submit your model results:
150
+ 1. Prepare your results in the required format and upload the model to HuggingFace
151
+ 2. Write down your repository name in the "Model name" text box
152
+ 3. Results will be automatically updated on the leaderboard
153
+
154
+ """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  )
156
+
157
+ with gr.Column(scale=1):
158
+ model_box = gr.Textbox(
159
+ label="Model name",
160
+ placeholder="Repository in format: ''user_name/model_name''",
161
+ scale=3,
162
+ max_lines=1,
163
  )
164
+ submit_model_btn = gr.Button("Submit ✉️")
165
+
166
+ gr.Markdown(
167
+ """### Data Sources
168
 
169
+ All data is loaded from Hugging Face datasets and updated regularly.
 
 
170
 
171
+ ### Contact
172
+
173
+ For questions or issues, please visit: [ESPnet GitHub](https://github.com/espnet/espnet)
174
+ """
175
+ )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
 
177
  submit_model_btn.click(
178
  fn=_submit_model,
179
  inputs=[model_box],
180
  outputs=[model_box]
181
  )
182
+
 
 
 
 
 
 
 
 
 
 
183
  return