frankrobotics commited on
Commit
50ca8c0
·
verified ·
1 Parent(s): 9a41d5b

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gr from gradio
2
+ import json
3
+
4
+ from transformers import pipeline
5
+ classifier = pipeline("zero-shot-classification", model="facebook/bart-large-mnli")
6
+
7
+ def tagging(
8
+ input: str,
9
+ tags: tuple[str]
10
+ ):
11
+ text = json.loads(str)
12
+ return text;
13
+
14
+ app = gr.Interface(fn=tagging, inputs=[
15
+ gr.Textbox(label="Your input here"),
16
+ gr.Textbox(label="Your input here")
17
+ ], outputs="text")
18
+
19
+ app.launch()