File size: 310 Bytes
7314527 | 1 2 3 4 5 6 7 8 9 10 | from langchain.embeddings import HuggingFaceEmbeddings
import torch
def download_embeding():
embedding = HuggingFaceEmbeddings(
model_name="sentence-transformers/all-MiniLM-L6-v2",
model_kwargs={"device": "cuda" if torch.cuda.is_available() else "cpu"}
)
return embedding |