embedding loading on cpu

This commit is contained in:
timothyafolami
2024-08-16 23:09:27 +01:00
parent 65a5bcfe43
commit 126c9e96cd
+1 -1
View File
@@ -49,7 +49,7 @@ GROQ_LLM = ChatGroq(temperature=0, model_name="llama3-8b-8192", max_tokens=100)
# loading the embedding model
def load_embedding_model():
model_name = "BAAI/bge-small-en"
model_kwargs = {"device": "cuda"} #can also be cpu
model_kwargs = {"device": "cpu"} #can also be cpu
encode_kwargs = {"normalize_embeddings": True}
embeddings = HuggingFaceBgeEmbeddings(
model_name=model_name, model_kwargs=model_kwargs, encode_kwargs=encode_kwargs