Emanai commited on
Commit
8b9d248
·
verified ·
1 Parent(s): 4ff5c43

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ # Load the fine-tuned model from Hugging Face Hub
5
+ classifier = pipeline("text-classification", model="Emanai/my-finetuned-bert2")
6
+
7
+ def classify_text(text):
8
+ return classifier(text)[0]
9
+
10
+ # Create a simple Gradio interface
11
+ iface = gr.Interface(fn=classify_text, inputs="text", outputs="label")
12
+
13
+ # Launch the Gradio app
14
+ iface.launch()