Spaces:
Runtime error
Runtime error
Download inference.py from filipeclduarte/minimalFlaskAPI: direct link, hf CLI and curl.
- Browser
- Download file 362 Bytes
-
https://huggingface.co/spaces/filipeclduarte/minimalFlaskAPI/resolve/e29864f15e92fe37aec0ebb8dca3b2bfdb07b158/inference.py
- Command line
-
hf download hf://spaces/filipeclduarte/minimalFlaskAPI@e29864f15e92fe37aec0ebb8dca3b2bfdb07b158/inference.py
-
curl -L -o inference.py https://huggingface.co/spaces/filipeclduarte/minimalFlaskAPI/resolve/e29864f15e92fe37aec0ebb8dca3b2bfdb07b158/inference.py
362 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): | |
| return classifier(data) |