alexpantex commited on
Commit
0ea4e58
·
verified ·
1 Parent(s): 8f8231b

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -1,14 +1,15 @@
1
  import threading
2
  import streamlit as st
 
3
  from scripts.api import start_api_server
4
  import os
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
11
- API_URL = f"http://localhost:{os.getenv('API_PORT', '8000')}/search"
 
12
 
13
  st.title("Prompt Search App")
14
  st.write("Enter a query below to find similar prompts.")
 
1
  import threading
2
  import streamlit as st
3
+ import requests
4
  from scripts.api import start_api_server
5
  import os
6
  # Start the API server in a separate thread
7
  api_thread = threading.Thread(target=start_api_server)
8
  api_thread.start()
 
9
 
10
  # Use localhost as FastAPI and Streamlit run in the same environment on Spaces
11
+ API_PORT = os.getenv("PORT", "7860")
12
+ API_URL = f"http://localhost:{API_PORT}/search"
13
 
14
  st.title("Prompt Search App")
15
  st.write("Enter a query below to find similar prompts.")