Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| import requests | |
| st.title("AI Chatbot") | |
| user_input = st.text_input("You: ", "") | |
| if st.button("Send"): | |
| response = requests.post("http://127.0.0.1:8000/generate", json={"prompt": user_input}, stream=True) | |
| with st.empty(): | |
| for line in response.iter_lines(): | |
| if line: | |
| st.write(line.decode("utf-8")) |