Commit
•
f3ddcb4
1
Parent(s):
580dfff
fix model info token
Browse files- app.py +1 -1
- utils/hub_info.py +2 -3
app.py
CHANGED
@@ -58,7 +58,7 @@ def get_leaderboard_df():
|
|
58 |
df['model name'] = df['model name'].str.replace('@', '/')
|
59 |
|
60 |
#### add model size
|
61 |
-
df['model size'] = df['model name'].apply(lambda x: get_model_size(x))
|
62 |
|
63 |
st.session_state['leaderboard_df'] = df
|
64 |
return df
|
|
|
58 |
df['model name'] = df['model name'].str.replace('@', '/')
|
59 |
|
60 |
#### add model size
|
61 |
+
df['model size'] = df['model name'].apply(lambda x: get_model_size(x, token=HUB_TOKEN))
|
62 |
|
63 |
st.session_state['leaderboard_df'] = df
|
64 |
return df
|
utils/hub_info.py
CHANGED
@@ -1,9 +1,8 @@
|
|
1 |
from huggingface_hub import HfApi
|
2 |
|
3 |
-
api = HfApi()
|
4 |
|
5 |
-
def get_model_size(model_name_or_path):
|
6 |
-
|
7 |
|
8 |
try:
|
9 |
model_info = api.model_info(model_name_or_path, timeout=10)
|
|
|
1 |
from huggingface_hub import HfApi
|
2 |
|
|
|
3 |
|
4 |
+
def get_model_size(model_name_or_path, token=None):
|
5 |
+
api = HfApi(token=token)
|
6 |
|
7 |
try:
|
8 |
model_info = api.model_info(model_name_or_path, timeout=10)
|