Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ def sentiment(text):
|
|
22 |
tokenized = tokenizer(text, return_tensors='pt')
|
23 |
with torch.no_grad():
|
24 |
outputs = model.generate(
|
25 |
-
input_ids=tokenized["input_ids"], attention_mask=tokenized["attention_mask"]
|
26 |
)
|
27 |
return f"text: {text} Sentiment: {tokenizer.decode(outputs[0], skip_special_tokens=True).split(' ')[-1]}"
|
28 |
|
|
|
22 |
tokenized = tokenizer(text, return_tensors='pt')
|
23 |
with torch.no_grad():
|
24 |
outputs = model.generate(
|
25 |
+
input_ids=tokenized["input_ids"], attention_mask=tokenized["attention_mask"]
|
26 |
)
|
27 |
return f"text: {text} Sentiment: {tokenizer.decode(outputs[0], skip_special_tokens=True).split(' ')[-1]}"
|
28 |
|