Spaces:
Runtime error
Runtime error
model
Browse files
app.py
CHANGED
|
@@ -1,6 +1,17 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
input_text = st.text_area("Enter your sample")
|
| 5 |
-
input_label = st.text_input("support, help, important")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
|
| 3 |
+
from transformers import pipeline
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
classifier = pipeline("zero-shot-classification",
|
| 7 |
+
model="valhalla/distilbart-mnli-12-1")
|
| 8 |
+
|
| 9 |
|
| 10 |
input_text = st.text_area("Enter your sample")
|
| 11 |
+
input_label = st.text_input("Enter labels", placeholder="support, help, important")
|
| 12 |
+
|
| 13 |
+
labels = input_label.split(',')
|
| 14 |
+
|
| 15 |
+
pred = classifier(input_text, labels, multi_class=True)
|
| 16 |
|
| 17 |
+
st.markdown(pred)
|