Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,7 +18,9 @@ os.environ['OPENAI_API_KEY'] = OPENAI_API_KEY
|
|
| 18 |
@st.cache_resource
|
| 19 |
def embedding_db():
|
| 20 |
embeddings = OpenAIEmbeddings()
|
| 21 |
-
|
|
|
|
|
|
|
| 22 |
api_key=PINECONE_API_KEY,
|
| 23 |
environment=PINECONE_ENV
|
| 24 |
)
|
|
@@ -31,6 +33,7 @@ def embedding_db():
|
|
| 31 |
metric='euclidean'
|
| 32 |
)
|
| 33 |
|
|
|
|
| 34 |
docs_split = doc_preprocessing() # Make sure this function is defined
|
| 35 |
doc_db = Pinecone.from_documents(
|
| 36 |
docs_split,
|
|
|
|
| 18 |
@st.cache_resource
|
| 19 |
def embedding_db():
|
| 20 |
embeddings = OpenAIEmbeddings()
|
| 21 |
+
|
| 22 |
+
# Updated Pinecone initialization
|
| 23 |
+
pc = Pinecone(
|
| 24 |
api_key=PINECONE_API_KEY,
|
| 25 |
environment=PINECONE_ENV
|
| 26 |
)
|
|
|
|
| 33 |
metric='euclidean'
|
| 34 |
)
|
| 35 |
|
| 36 |
+
|
| 37 |
docs_split = doc_preprocessing() # Make sure this function is defined
|
| 38 |
doc_db = Pinecone.from_documents(
|
| 39 |
docs_split,
|