Instructions to use Sumedhzz/Sentiment-Analyzer-Quantized with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Sumedhzz/Sentiment-Analyzer-Quantized with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Sumedhzz/Sentiment-Analyzer-Quantized")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("Sumedhzz/Sentiment-Analyzer-Quantized") model = AutoModelForSequenceClassification.from_pretrained("Sumedhzz/Sentiment-Analyzer-Quantized") - Notebooks
- Google Colab
- Kaggle
File size: 448 Bytes
2598f76 dd96d2c 2598f76 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | from transformers import AutoTokenizer, pipeline
from optimum.onnxruntime import ORTModelForSequenceClassification
def init():
global classifier
model_id = "."
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = ORTModelForSequenceClassification.from_pretrained(model_id)
classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)
def __call__(data):
return classifier(data["inputs"]) |