lixuejing
commited on
Commit
·
4772f92
1
Parent(s):
a28724a
fix
Browse files- src/tools/collections.py +5 -3
src/tools/collections.py
CHANGED
@@ -2,7 +2,7 @@ import os
|
|
2 |
|
3 |
import pandas as pd
|
4 |
from huggingface_hub import add_collection_item, delete_collection_item, get_collection, update_collection_item
|
5 |
-
from huggingface_hub.utils._errors import HfHubHTTPError
|
6 |
from pandas import DataFrame
|
7 |
|
8 |
from src.display.utils import AutoEvalColumn, ModelType
|
@@ -69,7 +69,8 @@ def update_collections(df: DataFrame):
|
|
69 |
cur_len_collection = len(collection.items)
|
70 |
cur_best_models.append(model)
|
71 |
break
|
72 |
-
except HfHubHTTPError:
|
|
|
73 |
continue
|
74 |
|
75 |
collection = get_collection(PATH_TO_COLLECTION, token=TOKEN)
|
@@ -79,5 +80,6 @@ def update_collections(df: DataFrame):
|
|
79 |
delete_collection_item(
|
80 |
collection_slug=PATH_TO_COLLECTION, item_object_id=item.item_object_id, token=TOKEN
|
81 |
)
|
82 |
-
except HfHubHTTPError:
|
|
|
83 |
continue
|
|
|
2 |
|
3 |
import pandas as pd
|
4 |
from huggingface_hub import add_collection_item, delete_collection_item, get_collection, update_collection_item
|
5 |
+
#from huggingface_hub.utils._errors import HfHubHTTPError
|
6 |
from pandas import DataFrame
|
7 |
|
8 |
from src.display.utils import AutoEvalColumn, ModelType
|
|
|
69 |
cur_len_collection = len(collection.items)
|
70 |
cur_best_models.append(model)
|
71 |
break
|
72 |
+
#except HfHubHTTPError:
|
73 |
+
except:
|
74 |
continue
|
75 |
|
76 |
collection = get_collection(PATH_TO_COLLECTION, token=TOKEN)
|
|
|
80 |
delete_collection_item(
|
81 |
collection_slug=PATH_TO_COLLECTION, item_object_id=item.item_object_id, token=TOKEN
|
82 |
)
|
83 |
+
#except HfHubHTTPError:
|
84 |
+
except:
|
85 |
continue
|