yolov7-test / model-test.py
Alanhau's picture
Update model-test.py
e695e6e
raw
history blame contribute delete
383 Bytes
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from transformers import pipeline
tokenizer = AutoTokenizer.from_pretrained("Alanhau/test")
model = AutoModelForSequenceClassification.from_pretrained("Alanhau/test")
nlp = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)
sentences = ["hate you!"]
results = nlp(sentences)
print(results)