Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import requests
|
2 |
+
import streamlit as st
|
3 |
+
|
4 |
+
# Replace with the actual URL of your deployed FastAPI backend
|
5 |
+
API_URL = "http://127.0.0.1:8000/predict"
|
6 |
+
|
7 |
+
def main():
|
8 |
+
text_input = st.text_input("Enter text to score:")
|
9 |
+
if st.button("Score Text"):
|
10 |
+
response = requests.post(API_URL, json={"text": text_input})
|
11 |
+
data = response.json()
|
12 |
+
st.write(f"Score: {data['score']}")
|
13 |
+
st.write(f"Message: {data['message']}")
|
14 |
+
|
15 |
+
if __name__ == "__main__":
|
16 |
+
main()
|