Spaces:
Running
Running
Update custom_utils.py
Browse files- custom_utils.py +4 -3
custom_utils.py
CHANGED
@@ -21,11 +21,12 @@ def connect_to_database():
|
|
21 |
return db, collection
|
22 |
|
23 |
def rag_ingestion(collection):
|
24 |
-
dataset = load_dataset("
|
25 |
dataset_df = pd.DataFrame(dataset)
|
26 |
-
listings = process_records(dataset_df)
|
27 |
collection.delete_many({})
|
28 |
-
collection.insert_many(listings)
|
|
|
29 |
return "Manually create a vector search index (in free tier, this feature is not available via SDK)"
|
30 |
|
31 |
def rag_retrieval(openai_api_key, prompt, db, collection, stages=[], vector_index="vector_index"):
|
|
|
21 |
return db, collection
|
22 |
|
23 |
def rag_ingestion(collection):
|
24 |
+
dataset = load_dataset("bstraehle/airbnb-san-francisco-202403-embed", streaming=True, split="train")
|
25 |
dataset_df = pd.DataFrame(dataset)
|
26 |
+
#listings = process_records(dataset_df)
|
27 |
collection.delete_many({})
|
28 |
+
#collection.insert_many(listings)
|
29 |
+
collection.insert_many(dataset_df)
|
30 |
return "Manually create a vector search index (in free tier, this feature is not available via SDK)"
|
31 |
|
32 |
def rag_retrieval(openai_api_key, prompt, db, collection, stages=[], vector_index="vector_index"):
|