Spaces:
Sleeping
Sleeping
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
@@ -1,4 +1,10 @@
|
|
|
|
1 |
import streamlit as st
|
|
|
|
|
|
|
|
|
|
|
2 |
import requests
|
3 |
|
4 |
# Use localhost as FastAPI and Streamlit run in the same environment on Spaces
|
|
|
1 |
+
import threading
|
2 |
import streamlit as st
|
3 |
+
from scripts.api import start_api_server
|
4 |
+
|
5 |
+
# Start the API server in a separate thread
|
6 |
+
api_thread = threading.Thread(target=start_api_server)
|
7 |
+
api_thread.start()
|
8 |
import requests
|
9 |
|
10 |
# Use localhost as FastAPI and Streamlit run in the same environment on Spaces
|