garrettbaber commited on
Commit
38d7836
1 Parent(s): 17831ec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -1,3 +1,13 @@
1
  import gradio as gr
 
2
 
3
- gr.Interface.load("models/garrettbaber/twitter-roberta-base-fear-intensity").launch()
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ from transformers import AutoModelForSequenceClassification, AutoTokenizer
3
 
4
+ def processInput(data):
5
+ model = AutoModelForSequenceClassification.from_pretrained("garrettbaber/twitter-roberta-base-fear-intensity")
6
+ tokenizer = AutoTokenizer.from_pretrained("garrettbaber/twitter-roberta-base-fear-intensity")
7
+ inputs = tokenizer("I'm scared", return_tensors="pt")
8
+ outputs = model(**inputs)
9
+ return outputs
10
+
11
+ app = gr.Interface(fn=processInput, inputs="text", outputs="text")
12
+
13
+ app.launch()