You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I call save_to_hub, it throws an exception: TypeError: HfApi.create_repo() got an unexpected keyword argument 'organization'. This is because it calls outdated API and doesn't work with the latest version of huggingface-hub.
The issue is actually fixed on master branch. Would it be possible to make a new pypi release of sentence-transformers so that we can use the fix? Thank you!
Details
Repro:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer('all-MiniLM-L6-v2')
model.save_to_hub("loquats")
Error message and stack trace:
File /databricks/python/lib/python3.10/site-packages/sentence_transformers/SentenceTransformer.py:467, in SentenceTransformer.save_to_hub(self, repo_name, organization, private, commit_message, local_model_path, exist_ok, replace_model_card, train_datasets)
464 raise ValueError("You passed and invalid repository name: {}.".format(repo_name))
466 endpoint = "https://huggingface.co"
--> 467 repo_url = HfApi(endpoint=endpoint).create_repo(
468 token,
469 repo_name,
470 organization=organization,
471 private=private,
472 repo_type=None,
473 exist_ok=exist_ok,
474 )
475 full_model_name = repo_url[len(endpoint)+1:].strip("/")
477 with tempfile.TemporaryDirectory() as tmp_dir:
478 # First create the repo (and clone its content if it's nonempty).
File /databricks/python/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs)
117 if check_use_auth_token:
118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs)
--> 120 return fn(*args, **kwargs)
TypeError: HfApi.create_repo() got an unexpected keyword argument 'organization'
Summary
When I call
save_to_hub
, it throws an exception:TypeError: HfApi.create_repo() got an unexpected keyword argument 'organization'
. This is because it calls outdated API and doesn't work with the latest version ofhuggingface-hub
.The issue is actually fixed on master branch. Would it be possible to make a new pypi release of sentence-transformers so that we can use the fix? Thank you!
Details
Repro:
Error message and stack trace:
Package versions:
(both are latest version)
sentence-transformers 2.2.2 calls an outdated implementation of create_repo here
This is actually fixed on master branch, so a workaround is to install the master version using:
Then I can run
save_to_hub
and it works.The text was updated successfully, but these errors were encountered: