Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -45,6 +45,53 @@ def refresh_leaderboard():
|
|
| 45 |
else:
|
| 46 |
return process_df(leaderboard_df)
|
| 47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
# Initialize an empty dataframe for the leaderboard
|
| 49 |
columns = ['Model', 'date', 'ucfd_eng', 'ucfd_lug',
|
| 50 |
'sema_eng', 'sema_lug', 'trac_fm_lug']
|
|
@@ -63,6 +110,9 @@ with block:
|
|
| 63 |
with gr.TabItem("ASR Leaderboard"):
|
| 64 |
with gr.Row():
|
| 65 |
data = gr.DataFrame(datatype="markdown")
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
input_json.upload(get_eval, inputs=input_json, outputs=data)
|
| 68 |
|
|
|
|
| 45 |
else:
|
| 46 |
return process_df(leaderboard_df)
|
| 47 |
|
| 48 |
+
# Usage markdown
|
| 49 |
+
usage = """
|
| 50 |
+
|
| 51 |
+
## Using the web interface
|
| 52 |
+
|
| 53 |
+
Run your model on the evaluation datasets and create a json file in this format:
|
| 54 |
+
```
|
| 55 |
+
[
|
| 56 |
+
{
|
| 57 |
+
"Model": "whisperbase",
|
| 58 |
+
"date": "",
|
| 59 |
+
"ucfd_eng": 102.27,
|
| 60 |
+
"ucfd_lug": "nan",
|
| 61 |
+
"sema_eng" : 42.86,
|
| 62 |
+
"sema_lug": "nan",
|
| 63 |
+
"trac_fm_lug": "nan",
|
| 64 |
+
"Link": "https://colab.research.google.com/drive/1MGGOotrjSXWkR3ljNEVvfEUResEx6OLV#scrollTo=Elwx1K3fEDjf"
|
| 65 |
+
},
|
| 66 |
+
{
|
| 67 |
+
"Model": "facebookmms",
|
| 68 |
+
"date": "2024-06-26",
|
| 69 |
+
"ucfd_eng": 92.91,
|
| 70 |
+
"ucfd_lug": "nan",
|
| 71 |
+
"sema_eng" : 63.39,
|
| 72 |
+
"sema_lug": "nan",
|
| 73 |
+
"trac_fm_lug": 69.29,
|
| 74 |
+
"Link": "https://colab.research.google.com/drive/1MGGOotrjSXWkR3ljNEVvfEUResEx6OLV#scrollTo=Elwx1K3fEDjf"
|
| 75 |
+
}
|
| 76 |
+
]
|
| 77 |
+
```
|
| 78 |
+
>Upload this to the leaderboard and it should be updated with your results.
|
| 79 |
+
|
| 80 |
+
## Using the API
|
| 81 |
+
|
| 82 |
+
You can use the following code to programmatically upload your results from a colab or python script.
|
| 83 |
+
```
|
| 84 |
+
from gradio_client import Client, handle_file
|
| 85 |
+
|
| 86 |
+
client = Client("sunbird/SB_ASR_Leaderboard")
|
| 87 |
+
result = client.predict(
|
| 88 |
+
jsonfile=handle_file([/path/to/eval_results.json]),
|
| 89 |
+
api_name="/get_eval"
|
| 90 |
+
)
|
| 91 |
+
```
|
| 92 |
+
>Refresh the leaderboard and your results should be visible.
|
| 93 |
+
"""
|
| 94 |
+
|
| 95 |
# Initialize an empty dataframe for the leaderboard
|
| 96 |
columns = ['Model', 'date', 'ucfd_eng', 'ucfd_lug',
|
| 97 |
'sema_eng', 'sema_lug', 'trac_fm_lug']
|
|
|
|
| 110 |
with gr.TabItem("ASR Leaderboard"):
|
| 111 |
with gr.Row():
|
| 112 |
data = gr.DataFrame(datatype="markdown")
|
| 113 |
+
with gr.TabItem("Usage"):
|
| 114 |
+
with gr.Row():
|
| 115 |
+
gr.Markdown(usage)
|
| 116 |
|
| 117 |
input_json.upload(get_eval, inputs=input_json, outputs=data)
|
| 118 |
|