Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -33,22 +33,20 @@ def invoke(openai_api_key, prompt, rag_option):
|
|
33 |
raise gr.Error("Retrieval-Augmented Generation is required.")
|
34 |
|
35 |
with lock:
|
36 |
-
#os.environ["OPENAI_API_KEY"] = openai_api_key
|
37 |
-
|
38 |
-
###
|
39 |
prompt = """
|
40 |
I want to stay in a place that's warm and friendly,
|
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")
|
|
|
33 |
raise gr.Error("Retrieval-Augmented Generation is required.")
|
34 |
|
35 |
with lock:
|
|
|
|
|
|
|
36 |
prompt = """
|
37 |
I want to stay in a place that's warm and friendly,
|
38 |
and not too far from resturants, can you recommend a place?
|
39 |
Include a reason as to why you've chosen your selection.
|
40 |
"""
|
41 |
+
|
42 |
print("111")
|
43 |
dataset = load_dataset("MongoDB/airbnb_embeddings", streaming=True, split="train")
|
44 |
+
#dataset = dataset.take(100)
|
45 |
print("222")
|
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 |
print("333")
|