Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -17,12 +17,17 @@ import os
|
|
17 |
PINECONE_API_KEY = os.getenv("PINECONE_API_KEY")
|
18 |
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
|
19 |
|
20 |
-
|
|
|
|
|
|
|
|
|
21 |
|
22 |
INDEX_NAME = "pdfbot1"
|
23 |
if INDEX_NAME not in pinecone.list_indexes():
|
24 |
pinecone.create_index(name=INDEX_NAME, metric="cosine", shards=1)
|
25 |
-
|
|
|
26 |
|
27 |
|
28 |
# Step 1: Clone the Dataset Repository
|
|
|
17 |
PINECONE_API_KEY = os.getenv("PINECONE_API_KEY")
|
18 |
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
|
19 |
|
20 |
+
|
21 |
+
pinecone.init(
|
22 |
+
PINECONE_API_KEY="PINECONE_API_KEY"
|
23 |
+
environment="gcp-starter" # next to api key in console
|
24 |
+
)
|
25 |
|
26 |
INDEX_NAME = "pdfbot1"
|
27 |
if INDEX_NAME not in pinecone.list_indexes():
|
28 |
pinecone.create_index(name=INDEX_NAME, metric="cosine", shards=1)
|
29 |
+
|
30 |
+
index = Pinecone.from_documents(docs, embeddings, index_name=index_name)
|
31 |
|
32 |
|
33 |
# Step 1: Clone the Dataset Repository
|