Update BrainBot.py
Browse files- BrainBot.py +2 -4
BrainBot.py
CHANGED
@@ -81,8 +81,7 @@ with col3:
|
|
81 |
# variable
|
82 |
with st.spinner("Activating OpenAI API..."):
|
83 |
try:
|
84 |
-
|
85 |
-
FASTAPI_URL = "https://huggingface.co/spaces/aminaj/BrainBot/set_api_key"
|
86 |
data = {"api_key": openai_api_key}
|
87 |
if openai_api_key:
|
88 |
response = requests.post(FASTAPI_URL, json=data)
|
@@ -131,8 +130,7 @@ if uploaded_file is not None:
|
|
131 |
try:
|
132 |
# Send POST request to a FastAPI endpoint to load the file into a vectorstore
|
133 |
data = {"file_path": temp_file_path, "file_type": uploaded_file.type}
|
134 |
-
|
135 |
-
FASTAPI_URL = f"https://huggingface.co/spaces/aminaj/BrainBot/load_file/{llm}"
|
136 |
st.write(FASTAPI_URL)
|
137 |
response = requests.post(FASTAPI_URL, json=data)
|
138 |
st.success(response.text)
|
|
|
81 |
# variable
|
82 |
with st.spinner("Activating OpenAI API..."):
|
83 |
try:
|
84 |
+
FASTAPI_URL = "http://localhost:8000/set_api_key"
|
|
|
85 |
data = {"api_key": openai_api_key}
|
86 |
if openai_api_key:
|
87 |
response = requests.post(FASTAPI_URL, json=data)
|
|
|
130 |
try:
|
131 |
# Send POST request to a FastAPI endpoint to load the file into a vectorstore
|
132 |
data = {"file_path": temp_file_path, "file_type": uploaded_file.type}
|
133 |
+
FASTAPI_URL = f"http://localhost:8000/load_file/{llm}"
|
|
|
134 |
st.write(FASTAPI_URL)
|
135 |
response = requests.post(FASTAPI_URL, json=data)
|
136 |
st.success(response.text)
|