huggingface / course

The Hugging Face course on Transformers
https://huggingface.co/course
Apache License 2.0
2.07k stars 677 forks source link

torch is not installed #632

Open scenaristeur opened 9 months ago

scenaristeur commented 9 months ago

following this tuto https://huggingface.co/learn/nlp-course/fr/chapter1/3?fw=pt with this config https://huggingface.co/learn/nlp-course/fr/chapter0/1?fw=pt#utilisation-dun-environnement-virtuel-python it appear that torch is not installed

python 01-sentiment.py 
None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used.
No model was supplied, defaulted to distilbert-base-uncased-finetuned-sst-2-english and revision af0f99b (https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english).
Using a pipeline without specifying a model name and revision in production is not recommended.
Downloading (…)lve/main/config.json: 100%|█████| 629/629 [00:00<00:00, 5.29MB/s]
Traceback (most recent call last):
[...]
infer_framework_load_model
    raise RuntimeError(
RuntimeError: At least one of TensorFlow 2.0 or PyTorch should be installed. To install TensorFlow 2.0, read the instructions at https://www.tensorflow.org/install/ To install PyTorch, read the instructions at https://pytorch.org/.

Should'nt you add "pip install torch" somewhere ?

ronaldpetty commented 2 months ago

Same for en, need PyTorch or TensorFlow (I am on a Mac).

https://github.com/huggingface/course/blob/main/chapters/en/chapter0/1.mdx