Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
|
|
| 1 |
from transformers import pipeline
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
|
|
|
|
| 8 |
|
| 9 |
-
#
|
| 10 |
-
|
| 11 |
-
t5_output = t5_model(input_text, max_length=100)
|
| 12 |
-
print("T5 Model Output:", t5_output)
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
+
# Load Zero-Shot Classification Model
|
| 5 |
+
zero_shot_classifier = pipeline("zero-shot-classification", model="facebook/bart-large-mnli")
|
| 6 |
|
| 7 |
+
# Input from the user
|
| 8 |
+
st.title("Zero-Shot Classification")
|
| 9 |
+
text_input = st.text_area("Enter text to classify:", "")
|
| 10 |
|
| 11 |
+
# Define possible candidate labels
|
| 12 |
+
candidate_labels = ["reasoning", "logic", "problem-solving", "explanation"]
|
|
|
|
|
|
|
| 13 |
|
| 14 |
+
# Run the zero-shot model
|
| 15 |
+
if text_input:
|
| 16 |
+
result = zero_shot_classifier(text_input, candidate_labels)
|
| 17 |
+
st.write(result)
|