Spaces:
Sleeping
Sleeping
Create app.py
Browse files
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()
|