langchain
It's possible to set device CPU for embeddingfrom langchain.embeddings.huggingface import HuggingFaceEmbeddings embedding_model = HuggingFaceEmbeddings( model_name="sentence-transformers/all-mpnet-base-v2", model_kwargs={"device": "cpu"}, # Use CPU for embedding )
from llama_index.embeddings.huggingface import HuggingFaceEmbedding
)os.cpu_count()
)