HarishMaths commited on
Commit
29db8e9
·
verified ·
1 Parent(s): 050581c

Update frontend.py

Browse files
Files changed (1) hide show
  1. frontend.py +11 -8
frontend.py CHANGED
@@ -1,8 +1,11 @@
1
- import streamlit as st
2
- import requests
3
-
4
- st.title("Streamlit + FastAPI on Hugging Face")
5
-
6
- # Call FastAPI backend
7
- response = requests.get("http://localhost:8000/api")
8
- st.write(response.json())
 
 
 
 
1
+ import streamlit as st
2
+ import requests
3
+
4
+ st.title("Streamlit + Flask on Hugging Face")
5
+
6
+ # Call Flask API
7
+ try:
8
+ res = requests.get("http://localhost:8000/api")
9
+ st.write(res.json())
10
+ except Exception as e:
11
+ st.error(f"Flask API call failed: {e}")