Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
|
|
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 |
|