Spaces:
Sleeping
Sleeping
Vela
commited on
Commit
·
6a3ea9d
1
Parent(s):
c038c12
modified dataloader_page
Browse files- src/backend/models/__pycache__/llm_model.cpython-313.pyc +0 -0
- src/backend/routes/__pycache__/upsert_data.cpython-313.pyc +0 -0
- src/backend/routes/upsert_data.py +1 -1
- src/backend/utils/__pycache__/logger.cpython-313.pyc +0 -0
- src/frontend/app/__pycache__/common_fuctions.cpython-313.pyc +0 -0
- src/frontend/app/common_fuctions.py +1 -1
- src/frontend/pages/dataloader_page.py +4 -8
src/backend/models/__pycache__/llm_model.cpython-313.pyc
CHANGED
Binary files a/src/backend/models/__pycache__/llm_model.cpython-313.pyc and b/src/backend/models/__pycache__/llm_model.cpython-313.pyc differ
|
|
src/backend/routes/__pycache__/upsert_data.cpython-313.pyc
CHANGED
Binary files a/src/backend/routes/__pycache__/upsert_data.cpython-313.pyc and b/src/backend/routes/__pycache__/upsert_data.cpython-313.pyc differ
|
|
src/backend/routes/upsert_data.py
CHANGED
@@ -13,7 +13,7 @@ async def upsert_data(add_data: Add_Data_In_DB):
|
|
13 |
start = add_data.start
|
14 |
end = add_data.end
|
15 |
df = dataset.get_data_set()[start:end]
|
16 |
-
pinecone_db.upsert_data_in_db(df
|
17 |
return {"status": "success"}
|
18 |
except Exception as e:
|
19 |
raise HTTPException(status_code=500, detail=str(e))
|
|
|
13 |
start = add_data.start
|
14 |
end = add_data.end
|
15 |
df = dataset.get_data_set()[start:end]
|
16 |
+
pinecone_db.upsert_data_in_db(df)
|
17 |
return {"status": "success"}
|
18 |
except Exception as e:
|
19 |
raise HTTPException(status_code=500, detail=str(e))
|
src/backend/utils/__pycache__/logger.cpython-313.pyc
CHANGED
Binary files a/src/backend/utils/__pycache__/logger.cpython-313.pyc and b/src/backend/utils/__pycache__/logger.cpython-313.pyc differ
|
|
src/frontend/app/__pycache__/common_fuctions.cpython-313.pyc
CHANGED
Binary files a/src/frontend/app/__pycache__/common_fuctions.cpython-313.pyc and b/src/frontend/app/__pycache__/common_fuctions.cpython-313.pyc differ
|
|
src/frontend/app/common_fuctions.py
CHANGED
@@ -45,7 +45,7 @@ def upsert_data_request(start, end):
|
|
45 |
try:
|
46 |
url = "http://localhost:8000/data/upsert_data"
|
47 |
response = requests.post(url, data=json.dumps(payload), headers=headers)
|
48 |
-
return response
|
49 |
except requests.exceptions.HTTPError as http_err:
|
50 |
print(f"HTTP error occurred: {http_err}")
|
51 |
except Exception as err:
|
|
|
45 |
try:
|
46 |
url = "http://localhost:8000/data/upsert_data"
|
47 |
response = requests.post(url, data=json.dumps(payload), headers=headers)
|
48 |
+
return response.json()
|
49 |
except requests.exceptions.HTTPError as http_err:
|
50 |
print(f"HTTP error occurred: {http_err}")
|
51 |
except Exception as err:
|
src/frontend/pages/dataloader_page.py
CHANGED
@@ -27,14 +27,10 @@ def load_data():
|
|
27 |
|
28 |
with st.spinner("⏳ Upserting data... Please wait"):
|
29 |
response = common_fuctions.upsert_data_request(start_index, end_index)
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
# else:
|
35 |
-
# st.error("Failed to upsert data.")
|
36 |
-
# logger.error("Failed to upsert data.")
|
37 |
-
# st.session_state.load_clicked = False
|
38 |
except Exception as e:
|
39 |
st.error(f"Error loading data: {e}")
|
40 |
logger.error(f"Error loading data: {e}")
|
|
|
27 |
|
28 |
with st.spinner("⏳ Upserting data... Please wait"):
|
29 |
response = common_fuctions.upsert_data_request(start_index, end_index)
|
30 |
+
if response.get("status") == "success":
|
31 |
+
st.success("Data upserted successfully!")
|
32 |
+
else:
|
33 |
+
st.error("Error upserting data.")
|
|
|
|
|
|
|
|
|
34 |
except Exception as e:
|
35 |
st.error(f"Error loading data: {e}")
|
36 |
logger.error(f"Error loading data: {e}")
|