AmirRghp commited on
Commit
ae28ea8
·
1 Parent(s): b6375d9

update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -1,7 +1,12 @@
1
  import gradio as gr
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
 
 
 
 
 
 
5
 
6
- demo = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- demo.launch()
 
1
  import gradio as gr
2
+ from transformers import pipeline
3
 
4
+ # Load your model from your Hugging Face profile
5
+ classifier = pipeline('text-classification', model='AmirRghp/distilbert-base-uncasedimdb-text-classification')
6
+
7
+ def classify_text(text):
8
+ result = classifier(text)
9
+ return result
10
+
11
+ gr.Interface(fn=classify_text, inputs="text", outputs="json").launch()
12