update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,12 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
|
|
|
|
|
|