Ritesh-hf commited on
Commit
a76610a
1 Parent(s): ffef210

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -16,6 +16,7 @@ from langchain.retrievers import ContextualCompressionRetriever
16
  from langchain.retrievers import EnsembleRetriever
17
  from langchain_community.vectorstores import FAISS
18
  from langchain_groq import ChatGroq
 
19
  from langchain import hub
20
  import pickle
21
  import os
@@ -46,7 +47,8 @@ app.config['SESSION_COOKIE_HTTPONLY'] = True
46
  app.config['SECRET_KEY'] = SECRET_KEY
47
 
48
  # Initialize Pinecone index and BM25 encoder
49
- pinecone_index = initialize_pinecone("uae-national-library-and-archives-vectorstore")
 
50
  bm25 = BM25Encoder().load("./UAE-NLA.json")
51
 
52
 
 
16
  from langchain.retrievers import EnsembleRetriever
17
  from langchain_community.vectorstores import FAISS
18
  from langchain_groq import ChatGroq
19
+ from pinecone import Pinecone, ServerlessSpec
20
  from langchain import hub
21
  import pickle
22
  import os
 
47
  app.config['SECRET_KEY'] = SECRET_KEY
48
 
49
  # Initialize Pinecone index and BM25 encoder
50
+ pc = Pinecone(api_key=PINECONE_API_KEY)
51
+ pinecone_index = pc.index("uae-national-library-and-archives-vectorstore")
52
  bm25 = BM25Encoder().load("./UAE-NLA.json")
53
 
54