Spaces:
Sleeping
Sleeping
Update embed_data.py
Browse files- embed_data.py +6 -5
embed_data.py
CHANGED
|
@@ -68,7 +68,7 @@ def initialize_pinecone():
|
|
| 68 |
def load_ebikes_data(file_path="ebikes_data.json"):
|
| 69 |
with open(file_path, 'r') as f:
|
| 70 |
data = json.load(f)
|
| 71 |
-
return data.get('
|
| 72 |
|
| 73 |
# Create embeddings and upload to Pinecone
|
| 74 |
def create_and_upload_embeddings(ebikes_data, encoder, pinecone_index):
|
|
@@ -81,10 +81,11 @@ def create_and_upload_embeddings(ebikes_data, encoder, pinecone_index):
|
|
| 81 |
ids.append(bike['id'])
|
| 82 |
descriptions.append(bike['description'])
|
| 83 |
metadata.append({
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
|
|
|
| 88 |
})
|
| 89 |
|
| 90 |
# Create embeddings
|
|
|
|
| 68 |
def load_ebikes_data(file_path="ebikes_data.json"):
|
| 69 |
with open(file_path, 'r') as f:
|
| 70 |
data = json.load(f)
|
| 71 |
+
return data.get('pogo-cycles-data', [])
|
| 72 |
|
| 73 |
# Create embeddings and upload to Pinecone
|
| 74 |
def create_and_upload_embeddings(ebikes_data, encoder, pinecone_index):
|
|
|
|
| 81 |
ids.append(bike['id'])
|
| 82 |
descriptions.append(bike['description'])
|
| 83 |
metadata.append({
|
| 84 |
+
"id": bike["id"],
|
| 85 |
+
"name": bike["name"],
|
| 86 |
+
"product_type": bike["type"], # or "escooter"
|
| 87 |
+
"category": bike["category"], # mountain / folding / cargo ...
|
| 88 |
+
"description": bike["description"]
|
| 89 |
})
|
| 90 |
|
| 91 |
# Create embeddings
|