hamdie commited on
Commit
43de91e
·
verified ·
1 Parent(s): 6ccf811

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -1,7 +1,11 @@
1
  import gradio as gr
 
2
 
3
- def greet(name):
4
- return "Hello " + sinda + "!!"
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
 
 
 
 
7
  iface.launch()
 
1
  import gradio as gr
2
+ from transformers import AutoModelForSequenceClassification
3
 
4
+ model = AutoModelForSequenceClassification.from_pretrained('..\arabert_pretrained')
 
5
 
6
+ def sentiment_analysis(text):
7
+ prediction = model.predict(text)
8
+ return prediction
9
+
10
+ iface = gr.Interface(fn=sentiment_analysis, inputs="text", outputs="text")
11
  iface.launch()