Could not load model
Could not load model snu-nia-12/wav2vec2-large-xlsr-53_nia12_phone-pinyin_chinese with any of the following classes: (<class 'transformers.models.wav2vec2.modeling_wav2vec2.Wav2Vec2ForCTC'>, <class 'transformers.models.wav2vec2.modeling_tf_wav2vec2.TFWav2Vec2ForCTC'>). See the original errors: while loading with Wav2Vec2ForCTC, an error is thrown: Traceback (most recent call last): File "/src/transformers/src/transformers/modeling_utils.py", line 530, in load_state_dict return torch.load( ^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/torch/serialization.py", line 1013, in load raise pickle.UnpicklingError(UNSAFE_MESSAGE + str(e)) from None _pickle.UnpicklingError: Weights only load failed. Re-running torch.load
with weights_only
set to False
will likely succeed, but it can result in arbitrary code execution.Do it only if you get the file from a trusted source. WeightsUnpickler error: Unsupported class fairseq.data.dictionary.Dictionary During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/src/transformers/src/transformers/modeling_utils.py", line 539, in load_state_dict if f.read(7) == "version": ^^^^^^^^^ File "", line 322, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 64: invalid start byte During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/src/transformers/src/transformers/pipelines/base.py", line 279, in infer_framework_load_model model = model_class.from_pretrained(model, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/src/transformers/src/transformers/modeling_utils.py", line 3308, in from_pretrained state_dict = load_state_dict(resolved_archive_file) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/src/transformers/src/transformers/modeling_utils.py", line 551, in load_state_dict raise OSError( OSError: Unable to load weights from pytorch checkpoint file for '/data/models--snu-nia-12--wav2vec2-large-xlsr-53_nia12_phone-pinyin_chinese/snapshots/a1ddf90c2e5fad38525917ad1700c4b85971c3b9/pytorch_model.bin' at '/data/models--snu-nia-12--wav2vec2-large-xlsr-53_nia12_phone-pinyin_chinese/snapshots/a1ddf90c2e5fad38525917ad1700c4b85971c3b9/pytorch_model.bin'. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True. while loading with TFWav2Vec2ForCTC, an error is thrown: Traceback (most recent call last): File "/src/transformers/src/transformers/pipelines/base.py", line 279, in infer_framework_load_model model = model_class.from_pretrained(model, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/src/transformers/src/transformers/modeling_tf_utils.py", line 2799, in from_pretrained raise EnvironmentError( OSError: snu-nia-12/wav2vec2-large-xlsr-53_nia12_phone-pinyin_chinese does not appear to have a file named tf_model.h5 but there is a file for PyTorch weights. Use from_pt=True
to load this model from those weights.