Eng-Musa commited on
Commit
0c9151c
·
1 Parent(s): c2da8e7

prevent tokenization issue

Browse files
clients/__pycache__/groq_client.cpython-312.pyc CHANGED
Binary files a/clients/__pycache__/groq_client.cpython-312.pyc and b/clients/__pycache__/groq_client.cpython-312.pyc differ
 
clients/groq_client.py CHANGED
@@ -236,7 +236,9 @@ Answer:
236
  # CHANGED: Replaced online HuggingFaceEndpointEmbeddings with local HuggingFaceEmbeddings
237
  # This downloads and stores the embedding model locally, eliminating API dependency
238
  embeddings_model = HuggingFaceEmbeddings(
239
- model_name="sentence-transformers/all-MiniLM-L6-v2"
 
 
240
  )
241
 
242
  # Clear old data to avoid duplicates
 
236
  # CHANGED: Replaced online HuggingFaceEndpointEmbeddings with local HuggingFaceEmbeddings
237
  # This downloads and stores the embedding model locally, eliminating API dependency
238
  embeddings_model = HuggingFaceEmbeddings(
239
+ model_name="sentence-transformers/all-MiniLM-L6-v2",
240
+ model_kwargs={'device': 'cpu'}, # Force CPU usage to avoid GPU conflicts
241
+ encode_kwargs={'normalize_embeddings': True} # Normalize embeddings for better similarity search
242
  )
243
 
244
  # Clear old data to avoid duplicates