Spaces:
Running
Running
updated LLM model
Browse files
app.py
CHANGED
@@ -66,7 +66,7 @@ def initialize_pinecone(index_name: str):
|
|
66 |
|
67 |
# Initialize Pinecone index and BM25 encoder
|
68 |
pinecone_index = initialize_pinecone("updated-mbzuai-policies-17112024")
|
69 |
-
bm25 = BM25Encoder().load("./
|
70 |
|
71 |
##################################################
|
72 |
##################################################
|
@@ -74,7 +74,7 @@ bm25 = BM25Encoder().load("./new_mbzuai-policies.json")
|
|
74 |
# old_embed_model = HuggingFaceEmbeddings(model_name="sentence-transformers/gte-multilingual-base")
|
75 |
|
76 |
# Initialize models and retriever
|
77 |
-
embed_model = HuggingFaceEmbeddings(model_name="
|
78 |
retriever = PineconeHybridSearchRetriever(
|
79 |
embeddings=embed_model,
|
80 |
sparse_encoder=bm25,
|
@@ -86,7 +86,7 @@ retriever = PineconeHybridSearchRetriever(
|
|
86 |
|
87 |
# Initialize LLM
|
88 |
# llm = ChatGroq(model="llama-3.1-70b-versatile", temperature=0, max_tokens=1024, max_retries=2)
|
89 |
-
llm = ChatPerplexity(temperature=0, pplx_api_key=GROQ_API_KEY, model="llama-3.1-sonar-large-128k-
|
90 |
|
91 |
|
92 |
# Initialize Reranker
|
|
|
66 |
|
67 |
# Initialize Pinecone index and BM25 encoder
|
68 |
pinecone_index = initialize_pinecone("updated-mbzuai-policies-17112024")
|
69 |
+
bm25 = BM25Encoder().load("./mbzuai-policies.json")
|
70 |
|
71 |
##################################################
|
72 |
##################################################
|
|
|
74 |
# old_embed_model = HuggingFaceEmbeddings(model_name="sentence-transformers/gte-multilingual-base")
|
75 |
|
76 |
# Initialize models and retriever
|
77 |
+
embed_model = HuggingFaceEmbeddings(model_name="jinaai/jina-embeddings-v3", model_kwargs={"trust_remote_code":True})
|
78 |
retriever = PineconeHybridSearchRetriever(
|
79 |
embeddings=embed_model,
|
80 |
sparse_encoder=bm25,
|
|
|
86 |
|
87 |
# Initialize LLM
|
88 |
# llm = ChatGroq(model="llama-3.1-70b-versatile", temperature=0, max_tokens=1024, max_retries=2)
|
89 |
+
llm = ChatPerplexity(temperature=0, pplx_api_key=GROQ_API_KEY, model="llama-3.1-sonar-large-128k-chat", max_tokens=1024, max_retries=2)
|
90 |
|
91 |
|
92 |
# Initialize Reranker
|