Spaces:
Runtime error
Runtime error
Download inference.py from filipeclduarte/minimalFlaskAPI: direct link, hf CLI and curl.
- Browser
- Download file 355 Bytes
-
https://huggingface.co/spaces/filipeclduarte/minimalFlaskAPI/resolve/910539097a40ffdb0b373bb4acdfd687f0027ca3/inference.py
- Command line
-
hf download hf://spaces/filipeclduarte/minimalFlaskAPI@910539097a40ffdb0b373bb4acdfd687f0027ca3/inference.py
-
curl -L -o inference.py https://huggingface.co/spaces/filipeclduarte/minimalFlaskAPI/resolve/910539097a40ffdb0b373bb4acdfd687f0027ca3/inference.py
355 Bytes
| from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline | |
| tokenizer = AutoTokenizer.from_pretrained("turing-usp/FinBertPTBR") | |
| model = AutoModelForSequenceClassification.from_pretrained("turing-usp/FinBertPTBR") | |
| classifier = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer) | |
| def predict(data): | |
| classifier(data) |