Removed some duplicated code (#35637)

* Removed duplicate class field definition.

* Removed duplicate code in try-except block.

---------

Co-authored-by: Pablo Montalvo <39954772+molbap@users.noreply.github.com>
This commit is contained in:
Sai-Suraj-27 2025-01-13 17:04:21 +05:30 committed by GitHub
parent b8c34d97fc
commit 91f14f1fc4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 0 additions and 8 deletions

View File

@ -196,7 +196,6 @@ class PaliGemmaPreTrainedModel(PreTrainedModel):
_supports_cache_class = True
_supports_quantized_cache = True
_supports_static_cache = True
_supports_cache_class = True
_supports_flash_attn_2 = True
_supports_sdpa = True

View File

@ -2292,13 +2292,6 @@ class PreTrainedTokenizerBase(SpecialTokensMixin, PushToHubMixin):
"Unable to load vocabulary from file. "
"Please check that the provided vocabulary is accessible and not corrupted."
)
except RuntimeError as e:
if "sentencepiece_processor.cc" in str(e):
logger.info(
"Unable to load tokenizer model from SPM, loading from TikToken will be attempted instead."
"(SentencePiece RuntimeError: Tried to load SPM model with non-SPM vocab file).",
)
return False
if added_tokens_decoder != {} and max(list(added_tokens_decoder.keys())[-1], 0) > tokenizer.vocab_size:
logger.info(