rushankg commited on
Commit
3725d22
·
verified ·
1 Parent(s): a6549e8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -112,7 +112,7 @@ def get_pinecone_index(database_id: str) -> Index:
112
  if not database_id in pc.list_indexes():
113
  pc.create_index(
114
  database_id,
115
- dimension=shape[1],
116
  spec=ServerlessSpec(
117
  cloud='aws',
118
  region='us-east-1'
@@ -153,8 +153,8 @@ def add_to_voyage(person_name: str, person_projects: list) -> None:
153
  # create list of (id, vector, metadata) tuples to be upserted
154
  to_upsert = list(zip(ids, embeds, meta))
155
 
156
- for i in range(0, shape[0], VOYAGEAI_BATCH_SIZE):
157
- i_end = min(i+VOYAGEAI_BATCH_SIZE, shape[0])
158
  index.upsert(vectors=to_upsert[i:i_end])
159
 
160
  # let's view the index statistics
 
112
  if not database_id in pc.list_indexes():
113
  pc.create_index(
114
  database_id,
115
+ dimension=VOYAGEAI_VECTOR_DIM,
116
  spec=ServerlessSpec(
117
  cloud='aws',
118
  region='us-east-1'
 
153
  # create list of (id, vector, metadata) tuples to be upserted
154
  to_upsert = list(zip(ids, embeds, meta))
155
 
156
+ for i in range(0, len(ids), VOYAGEAI_BATCH_SIZE):
157
+ i_end = min(i+VOYAGEAI_BATCH_SIZE, len(ids))
158
  index.upsert(vectors=to_upsert[i:i_end])
159
 
160
  # let's view the index statistics