yashkens commited on
Commit
9f6e2f8
1 Parent(s): d801d73

add emotion classification

Browse files
Files changed (1) hide show
  1. emotions.py +1 -1
emotions.py CHANGED
@@ -5,7 +5,7 @@ tokenizer = AutoTokenizer.from_pretrained("mrm8488/t5-base-finetuned-emotion")
5
  model = AutoModelWithLMHead.from_pretrained("mrm8488/t5-base-finetuned-emotion")
6
 
7
 
8
- def get_emotion(text):
9
  input_ids = tokenizer.encode(text + '</s>', return_tensors='pt')
10
 
11
  output = model.generate(input_ids=input_ids,
 
5
  model = AutoModelWithLMHead.from_pretrained("mrm8488/t5-base-finetuned-emotion")
6
 
7
 
8
+ def get_emotion(text='No text yet'):
9
  input_ids = tokenizer.encode(text + '</s>', return_tensors='pt')
10
 
11
  output = model.generate(input_ids=input_ids,