3 ms·
If you are like me and you tried to copy paste the python commands and it did not work, you need to generate an access token. Here is what you should do: 1. Si
by bluepoint 3y ago
If you are like me and you tried to copy paste the python commands and it did not work, you need to generate an access token. Here is what you should do:
1. Sign up (https://huggingface.co/ https://huggingface.co/) to hugging face.
2. Setup access tokens (https://huggingface.co/settings/tokens https://huggingface.co/settings/tokens)
3. Install or Upgrade some dependencies
`pip install huggingface_hub transformers accelerate`
4. From the terminal run `jupyter lab`
5. Then, if I did not forget any other dependencies you can just copy paste
```python
from huggingface_hub import login
from transformers import HfAgent
login("hf_YOUR_HUGGING_FACE_TOKEN")
agent = HfAgent("https://api-inference.huggingface.co/models/bigcode/starcoder https://api-inference.huggingface.co/models/bigcode/starcode...")
agent.run("Is the following `text` (in Spanish) positive or negative?", text="¡Este es un API muy agradable!")
```