Spaces:
Runtime error
Runtime error
app.py
CHANGED
@@ -6,12 +6,14 @@ from transformers import pipeline
|
|
6 |
classifier = pipeline("zero-shot-classification",
|
7 |
model="valhalla/distilbart-mnli-12-1")
|
8 |
|
|
|
|
|
|
|
|
|
9 |
|
10 |
-
|
11 |
-
input_label = st.text_input("Enter labels", placeholder="support, help, important")
|
12 |
|
13 |
-
labels = input_label.split(',')
|
|
|
14 |
|
15 |
-
pred
|
16 |
-
|
17 |
-
st.markdown(pred)
|
|
|
6 |
classifier = pipeline("zero-shot-classification",
|
7 |
model="valhalla/distilbart-mnli-12-1")
|
8 |
|
9 |
+
with st.form('inputs') as form:
|
10 |
+
input_text = form.text_area("Enter your sample")
|
11 |
+
input_label = form.text_input("Enter labels", placeholder="support, help, important")
|
12 |
+
submit_button = form.form_submit_button(label='Submit')
|
13 |
|
14 |
+
if submit_button:
|
|
|
15 |
|
16 |
+
labels = list(l.strip() for l in input_label.split(','))
|
17 |
+
pred = classifier(input_text, labels, multi_class=True)
|
18 |
|
19 |
+
st.markdown(pred)
|
|
|
|