Spaces:
Runtime error
Runtime error
| import streamlit as st | |
| from transformers import pipeline | |
| st.title("🌱 Sustainable Smart City Assistant") | |
| st.write("Ask me about eco-friendly tips, traffic, waste collection, and more.") | |
| assistant = pipeline("text2text-generation", model="google/flan-t5-large") | |
| user_input = st.text_input("Type your question here:") | |
| if user_input: | |
| prompt = f"You are a smart city assistant. Answer clearly.\n\nQuestion: {user_input}" | |
| response = assistant(prompt, max_length=100)[0]['generated_text'] | |
| st.success(response) | |