Spaces:
Build error
Build error
Commit
·
3ceb12a
1
Parent(s):
3f6e7fc
Update weaviate_utils.py
Browse files- weaviate_utils.py +6 -2
weaviate_utils.py
CHANGED
|
@@ -91,8 +91,12 @@ def ingest_data_to_weaviate(client, csv_file, selected_class):
|
|
| 91 |
return
|
| 92 |
|
| 93 |
# Ingest the data into Weaviate
|
| 94 |
-
data =
|
| 95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
# Display a preview of the ingested data
|
| 98 |
st.write(f"Your CSV was successfully integrated into the vector database under the class '{selected_class}'")
|
|
|
|
| 91 |
return
|
| 92 |
|
| 93 |
# Ingest the data into Weaviate
|
| 94 |
+
data = dataframe.to_dict(orient="records")
|
| 95 |
+
for record in data:
|
| 96 |
+
try:
|
| 97 |
+
client.data_object.create(record, selected_class)
|
| 98 |
+
except Exception as e:
|
| 99 |
+
st.error(f"Error ingesting record: {e}")
|
| 100 |
|
| 101 |
# Display a preview of the ingested data
|
| 102 |
st.write(f"Your CSV was successfully integrated into the vector database under the class '{selected_class}'")
|