CoolFace
Apppublic

LastSmile/CodeLlama-7b

sourceHugging Faceapache-2.0updated 3y agoView on Hugging Face
0likes
streamlit_app.py24 linesDownload Raw Back to root
1import streamlit as st2import requests3 4# Run this with: streamlit run streamlit_app.py5# Streamlit interface6st.title("Gemini Central Console Bot")7user_input = st.text_input("Enter your text here")8url = "http://localhost:8000/predict"  # URL of your FastAPI predict endpoint9 10if st.button("Submit"):11    # Prepare the payload12    payload = {"prompt": user_input}13 14    # Send the request to FastAPI endpoint15    response = requests.post(url, json=payload)16 17    # Display the response18    if response.status_code == 200:19        result = response.json()20        content = result["choices"][0]["message"]["content"]21        st.write(content)22    else:23        st.write("Failed to get response")24