Remove redundant error logging in from_pretrained() method (#15631)

* Remove error logging in from_pretrained() method
This commit is contained in:
lewtun
2022-02-14 18:03:07 +01:00
committed by GitHub
parent b090b79022
commit 0f71c29053
7 changed files with 29 additions and 61 deletions

View File

@@ -1738,16 +1738,14 @@ class PreTrainedTokenizerBase(SpecialTokensMixin, PushToHubMixin):
else:
raise error
except RepositoryNotFoundError as err:
logger.error(err)
except RepositoryNotFoundError:
raise EnvironmentError(
f"{pretrained_model_name_or_path} is not a local folder and is not a valid model identifier "
"listed on 'https://huggingface.co/models'\nIf this is a private repository, make sure to "
"pass a token having permission to this repo with `use_auth_token` or log in with "
"`huggingface-cli login` and pass `use_auth_token=True`."
)
except RevisionNotFoundError as err:
logger.error(err)
except RevisionNotFoundError:
raise EnvironmentError(
f"{revision} is not a valid git identifier (branch name, tag name or commit id) that exists "
"for this model name. Check the model page at "