NotSoundRated commited on
Commit
29e2260
·
verified ·
1 Parent(s): 4fc0a20

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -4
app.py CHANGED
@@ -1,6 +1,16 @@
1
  import gradio as gr
 
2
 
3
- gr.load(
4
- "models/microsoft/deberta-v3-small",
5
- provider="hf-inference",
6
- ).launch()
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ from transformers import pipeline
3
 
4
+ classifier = pipeline("zero-shot-classification", model="facebook/bart-large-mnli")
5
+
6
+ def classify(text, labels):
7
+ return classifier(text, candidate_labels=labels)
8
+
9
+ iface = gr.Interface(
10
+ fn=classify,
11
+ inputs=[gr.Text(label="Text"), gr.Textbox(lines=1, label="Candidate Labels (comma-separated)")],
12
+ outputs="json"
13
+ )
14
+
15
+ if __name__ == "__main__":
16
+ iface.launch()