fyp-deploy / app.py
Mairaaa's picture
Add Streamlit app
458eaee
raw
history blame
615 Bytes
import streamlit as st
import requests
# Title of the app
st.title("Backend API Test")
st.write("This app interacts with the backend to generate output.")
# Input from the user
input_data = st.text_input("Enter Input Data:", "")
if st.button("Generate"):
# Make a POST request to your backend
response = requests.post("http://127.0.0.1:8000/predict", json={"input_data": input_data})
# Handle the response
if response.status_code == 200:
st.write("Result:", response.json().get("result", "No result found"))
else:
st.error(f"Error: {response.status_code} - {response.text}")