bstraehle commited on
Commit
3b33b42
·
verified ·
1 Parent(s): 18cc95d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -7
app.py CHANGED
@@ -41,20 +41,26 @@ def invoke(openai_api_key, prompt, rag_option):
41
  and not too far from resturants, can you recommend a place?
42
  Include a reason as to why you've chosen your selection.
43
  """
 
44
  dataset = load_dataset("MongoDB/airbnb_embeddings", streaming=True, split="train")
45
  dataset = dataset.take(100)
 
46
  # Convert the dataset to a pandas dataframe
47
  dataset_df = pd.DataFrame(dataset)
48
  dataset_df.head(5)
49
  print("Columns:", dataset_df.columns)
50
 
51
  listings = process_records(dataset_df)
52
-
 
 
53
  db, collection = connect_to_database()
54
  collection.delete_many({})
55
  collection.insert_many(listings)
56
  print("Data ingestion into MongoDB completed")
57
-
 
 
58
  setup_vector_search_index(collection=collection)
59
 
60
  search_path = "address.country"
@@ -69,12 +75,9 @@ def invoke(openai_api_key, prompt, rag_option):
69
 
70
  additional_stages = [match_stage]
71
 
72
- query = """
73
- I want to stay in a place that's warm and friendly,
74
- and not too far from resturants, can you recommend a place?
75
- Include a reason as to why you've chosen your selection"
76
- """
77
  result = handle_user_query(openai_api_key, query, db, collection, additional_stages)
 
 
78
  ###
79
 
80
  return result
 
41
  and not too far from resturants, can you recommend a place?
42
  Include a reason as to why you've chosen your selection.
43
  """
44
+ print("111")
45
  dataset = load_dataset("MongoDB/airbnb_embeddings", streaming=True, split="train")
46
  dataset = dataset.take(100)
47
+ print("222")
48
  # Convert the dataset to a pandas dataframe
49
  dataset_df = pd.DataFrame(dataset)
50
  dataset_df.head(5)
51
  print("Columns:", dataset_df.columns)
52
 
53
  listings = process_records(dataset_df)
54
+ print("333")
55
+
56
+ print("444")
57
  db, collection = connect_to_database()
58
  collection.delete_many({})
59
  collection.insert_many(listings)
60
  print("Data ingestion into MongoDB completed")
61
+ print("555")
62
+
63
+ """
64
  setup_vector_search_index(collection=collection)
65
 
66
  search_path = "address.country"
 
75
 
76
  additional_stages = [match_stage]
77
 
 
 
 
 
 
78
  result = handle_user_query(openai_api_key, query, db, collection, additional_stages)
79
+ """
80
+ result = "TODO"
81
  ###
82
 
83
  return result