Last active
October 28, 2024 14:55
-
-
Save devmnj/1bf4e2deebc21506c76d895e5d84bbd5 to your computer and use it in GitHub Desktop.
Use hugging face models in Colab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//authenticate hf with token | |
import huggingface_hub | |
huggingface_hub.login() | |
//Use the model | |
sentiment_pipeline = pipeline("sentiment-analysis", model="distilbert-base-uncased-finetuned-sst-2-english") | |
result = sentiment_pipeline("Tesla's latest earnings report exceeded expectations, leading to a surge in stock price.") | |
print(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment