Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,6 +6,7 @@ import re
|
|
| 6 |
import pandas as pd
|
| 7 |
from huggingface_hub import ModelCard
|
| 8 |
|
|
|
|
| 9 |
def pass_emoji(passed):
|
| 10 |
if passed is True:
|
| 11 |
passed = "✅"
|
|
@@ -15,6 +16,7 @@ def pass_emoji(passed):
|
|
| 15 |
|
| 16 |
api = HfApi()
|
| 17 |
|
|
|
|
| 18 |
def get_user_audio_classification_models(hf_username):
|
| 19 |
"""
|
| 20 |
List the user's Audio Classification models
|
|
@@ -29,9 +31,10 @@ def get_user_audio_classification_models(hf_username):
|
|
| 29 |
meta = get_metadata(model)
|
| 30 |
if meta is None:
|
| 31 |
continue
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
|
|
|
| 35 |
return models_gtzan
|
| 36 |
|
| 37 |
|
|
@@ -129,6 +132,7 @@ def certification(hf_username):
|
|
| 129 |
]
|
| 130 |
|
| 131 |
for unit in results_certification:
|
|
|
|
| 132 |
if unit["task"] == "audio-classification":
|
| 133 |
user_models = get_user_audio_classification_models(hf_username)
|
| 134 |
best_result, best_model_id = calculate_best_acc_result(user_models)
|
|
@@ -139,7 +143,6 @@ def certification(hf_username):
|
|
| 139 |
unit["passed"] = pass_emoji(unit["passed_"])
|
| 140 |
else:
|
| 141 |
# TBD for other units
|
| 142 |
-
unit["passed"] = pass_emoji(unit["passed_"])
|
| 143 |
continue
|
| 144 |
|
| 145 |
print(results_certification)
|
|
|
|
| 6 |
import pandas as pd
|
| 7 |
from huggingface_hub import ModelCard
|
| 8 |
|
| 9 |
+
|
| 10 |
def pass_emoji(passed):
|
| 11 |
if passed is True:
|
| 12 |
passed = "✅"
|
|
|
|
| 16 |
|
| 17 |
api = HfApi()
|
| 18 |
|
| 19 |
+
|
| 20 |
def get_user_audio_classification_models(hf_username):
|
| 21 |
"""
|
| 22 |
List the user's Audio Classification models
|
|
|
|
| 31 |
meta = get_metadata(model)
|
| 32 |
if meta is None:
|
| 33 |
continue
|
| 34 |
+
try:
|
| 35 |
+
if meta["datasets"] == ['marsyas/gtzan']:
|
| 36 |
+
models_gtzan.append(model)
|
| 37 |
+
except: continue
|
| 38 |
return models_gtzan
|
| 39 |
|
| 40 |
|
|
|
|
| 132 |
]
|
| 133 |
|
| 134 |
for unit in results_certification:
|
| 135 |
+
unit["passed"] = pass_emoji(unit["passed_"])
|
| 136 |
if unit["task"] == "audio-classification":
|
| 137 |
user_models = get_user_audio_classification_models(hf_username)
|
| 138 |
best_result, best_model_id = calculate_best_acc_result(user_models)
|
|
|
|
| 143 |
unit["passed"] = pass_emoji(unit["passed_"])
|
| 144 |
else:
|
| 145 |
# TBD for other units
|
|
|
|
| 146 |
continue
|
| 147 |
|
| 148 |
print(results_certification)
|