Downloads · 30 days
16
1% of all-time downloads
addy88/T5-23-emotions-detections
T5-23-emotions-detections is a machine learning model from addy88. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
Here is how to use this model in PyTorch:
Downloads · 30 days
16
1% of all-time downloads
All-time downloads
1.4K
Public
Repo size
2 GB
Likes
0
Public
Click a slice to open those files.
.bin990 MB · 100%
From the Hugging Face model README
Here is how to use this model in PyTorch:
from transformers import T5Tokenizer, T5ForConditionalGeneration
model = T5ForConditionalGeneration.from_pretrained("addy88/T5-23-emotions-detections")
tokenizer = T5Tokenizer.from_pretrained("addy88/T5-23-emotions-detections")
text_to_summarize="emotion: i don't like it this is nonsense."
input_ids = tokenizer.encode(text_to_summarize, return_tensors="pt", add_special_tokens=True)
input_ids = input_ids.to(self.device)
generated_ids = model.generate(
input_ids=input_ids,
num_beams=2,
max_length=512,
repetition_penalty=2.5,
length_penalty=1.0,
early_stopping=True,
top_p=0.95,
top_k=50,
num_return_sequences=1,
)
preds = [tokenizer.decode(g,skip_special_tokens=True,clean_up_tokenization_spaces=True,)for g in generated_ids]