get_full_repo_name, # noqa: F401 @@ -508,6 +524,8 @@ def __dir__(): space_info, # noqa: F401 super_squash_history, # noqa: F401 unlike, # noqa: F401 update_collection_item, # noqa: F401 update_collection_metadata, # noqa: F401 update_repo_visibility, # noqa: F401 upload_...
def test_get_full_repo_name(self): repo_name_with_no_org = self._api.get_full_repo_name("model", token=self._token) @@ -463,10 +463,10 @@ def test_dataset_info(self): class HfApiPrivateTest(HfApiCommonTestWithLogin): def setUp(self) -> None: super().setUp() self._api.cr...
import*ashubfrom"@huggingface/hub";importtype{RepoDesignation}from"@huggingface/hub";constrepo:RepoDesignation={type:"model",name:"myname/some-model"};const{name:username}=awaithub.whoAmI({accessToken:"hf_..."});forawait(constmodelofhub.listModels({search:{owner:username},accessToken:"hf_....
get_full_repo_name, list_datasets, list_models, list_repo_files, list_repos_objs, login, logout, 14 changes: 14 additions & 0 deletions 14 src/huggingface_hub/hf_api.py Original file line numberDiff line numberDiff line change @@ -536,6 +536,19 @@ def model_info( d = r.json(...
(args.output_dir).name, token=args.hub_token) File "/home/sgugger/git/transformers/src/transformers/file_utils.py", line 2249, in get_full_repo_name username = HfApi().whoami(token)["name"] File "/home/sgugger/git/huggingface_hub/src/huggingface_hub/hf_api.py", line 330, in ...
This PR adds a small utility function to get the full repo name from a model ID which: extracts the username if no organization is passed and returns username/model_id just returns organization/mo...
model = api.model_info("your_model_id", securityStatus=True)#get security status info of your model-security_info = model.securityStatus+security_info = model.security_repo_status Update how file's security metadata is retrieved following changes in the API response by@hanouticelinain#2621 ...
$ huggingface-cli repo create -<TAB> Name for your repo. Will be namespaced under your username to build the repo id. option --help show this help message and exit -h show this help message and exit --organization Optional: organization namespace. --space_sdk Optional: Hugging Face Spac...
* Implement build_hf_headers helper * update auth headers everywhere * fix get full name * fix lru cache * remove datasets dependency + fix some test * fix _deprecate_arguments * test new deprecate arg * add tests * fix whoami * fix token in tests * send token by default all the time...
repo_id=f"{USER}/repo_that_do_not_exist", operations=[], # empty commit commit_message="fake_message", token=self._token, )request_id = context.exception.response.headers.get("X-Request-Id") expected_message = ( f"404 Client Error. (Request ID: {request_id})" ...