garrettbaber
commited on
Commit
•
0406460
1
Parent(s):
8ee74ad
Update app.py
Browse files
app.py
CHANGED
@@ -2,11 +2,12 @@ import gradio as gr
|
|
2 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
3 |
|
4 |
def processInput(input):
|
5 |
-
|
6 |
tokenizer = AutoTokenizer.from_pretrained("garrettbaber/twitter-roberta-base-fear-intensity")
|
7 |
tokens = tokenizer(input, return_tensors="pt")
|
8 |
-
|
9 |
-
|
|
|
10 |
|
11 |
app = gr.Interface(fn=processInput, inputs="text", outputs="text")
|
12 |
|
|
|
2 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
3 |
|
4 |
def processInput(input):
|
5 |
+
model = AutoModelForSequenceClassification.from_pretrained("garrettbaber/twitter-roberta-base-fear-intensity")
|
6 |
tokenizer = AutoTokenizer.from_pretrained("garrettbaber/twitter-roberta-base-fear-intensity")
|
7 |
tokens = tokenizer(input, return_tensors="pt")
|
8 |
+
print('Running tokens in model')
|
9 |
+
outputs = model(**inputs)
|
10 |
+
return outputs
|
11 |
|
12 |
app = gr.Interface(fn=processInput, inputs="text", outputs="text")
|
13 |
|