Update Transformers to huggingface_hub >= 0.1.0 (#14251)
* Update Transformers to huggingface_hub >= 0.1.0 * Forgot to save... * Style * Fix test
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
from huggingface_hub.hf_api import HfApi
|
||||
from huggingface_hub.hf_api import list_models
|
||||
from transformers import MarianConfig, is_torch_available
|
||||
from transformers.file_utils import cached_property
|
||||
from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torch_device
|
||||
@@ -296,7 +296,7 @@ class ModelManagementTests(unittest.TestCase):
|
||||
@slow
|
||||
@require_torch
|
||||
def test_model_names(self):
|
||||
model_list = HfApi().list_models()
|
||||
model_list = list_models()
|
||||
model_ids = [x.modelId for x in model_list if x.modelId.startswith(ORG_NAME)]
|
||||
bad_model_ids = [mid for mid in model_ids if "+" in model_ids]
|
||||
self.assertListEqual([], bad_model_ids)
|
||||
|
||||
Reference in New Issue
Block a user