AttributeError: module 'torch' has no attribute 'chalf'
Hi,I’m trying to run the following :from transformers import Seq2SeqTrainertrainer = Seq2SeqTrainer(args=training_args,model=model,train_dataset=common_voice[“train”],eval_dataset=common_voice[“test”],data_collator=data_collator,compute_metrics=compute_metrics,tokenizer=processor.feature_extractor,)but I face this error :Where this is the torch version I’m using :AttributeError                            Traceback (most recent call last)Cell In[71], line 31 from transformers import Seq2SeqTrainer----> 3 trainer = Seq2SeqTrainer(4     args=training_args,5     model=model,6     train_dataset=common_voice[“train”],7     eval_dataset=common_voice[“test”],8     data_collator=data_collator,9     compute_metrics=compute_metrics,10     tokenizer=processor.feature_extractor,11 )File ~/anaconda3/envs/whisper-training/lib/python3.9/site-packages/transformers/trainer_seq2seq.py:57, in Seq2SeqTrainer.init(self, model, args, data_collator, train_dataset, eval_dataset, tokenizer, model_init, compute_metrics, callbacks, optimizers, preprocess_logits_for_metrics)43 definit(44     self,45     model: Union[“PreTrainedModel”, nn.Module] = None,(…)55     preprocess_logits_for_metrics: Optional[Callable[[torch.Tensor, torch.Tensor], torch.Tensor]] = None,56 ):—> 57     super().init(58         model=model,59         args=args,60         data_collator=data_collator,…79 }82 def _calc_scale_factor(tensor):83     converted = tensor.numpy() if not isinstance(tensor, np.ndarray) else tensorAttributeError: module ‘torch’ has no attribute ‘chalf’Name: torchVersion: 1.10.0+cu113Summary: Tensors and Dynamic neural networks in Python with strong GPU accelerationwith python 3.9.19Note: I’m trying to fine-tune whisper-large-v3
2024-05-06T07:30:11Z
Could you provide a Colab notebook to reproduce?
2024-05-06T07:40:05Z
I’m following this notebook, but I just change the model type to large:colab.research.google.comGoogle Colab
2024-05-06T07:46:00Z
I’m following this notebook, but I change the model whisper 3 largecolab.research.google.comGoogle Colab
2024-05-06T07:48:18Z
I’m following the Haggingface article for fine-tune Whisper model on Common Voice dataset.
2024-05-06T07:49:08Z
It looks like your PyTorch version is outdated (1.10). Please consider upgrading PyTorch to the latest version:pip install --upgrade torchas explained here:Start Locally | PyTorch
2024-05-06T08:27:20Z
I tried with torch 2.3.9 but I face error with loading the model at :from transformers import WhisperForConditionalGenerationmodel = WhisperForConditionalGeneration.from_pretrained(“openai/whisper-large-v3”)Error: RuntimeError: Failed to import transformers.models.whisper.modeling_whisper because of the following error (look up to see its traceback):Failed to import transformers.generation.utils because of the following error (look up to see its traceback):cannot import name ‘DEFAULT_CIPHERS’ from ‘urllib3.util.ssl_’
2024-05-06T08:28:38Z
It looks like there’s something wrong with your local environment. I’d recommend creating a fresh virtual environment with a new PyTorch and Transformers installation
2024-05-06T09:15:36Z
Do you think it can be CUDA problem? the current version I’m using ic CUDA 12.4 with   torch 2.3.9