Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
|
| 4 |
+
# Load the model
|
| 5 |
+
model = pipeline("text2text-generation", model="t5-large")
|
| 6 |
+
|
| 7 |
+
# Streamlit App Layout
|
| 8 |
+
st.title("Zero-Shot Reasoning with T5")
|
| 9 |
+
input_text = st.text_area("Enter your question:")
|
| 10 |
+
|
| 11 |
+
if input_text:
|
| 12 |
+
output = model(input_text, max_length=100)
|
| 13 |
+
st.write(f"Response: {output[0]['generated_text']}")
|