Spaces:
Sleeping
Sleeping
cahnage machine to cuda
Browse filesmps is for mac selenium, cude for hugginface without gpu
app.py
CHANGED
|
@@ -36,13 +36,13 @@ def load_from_azure(container_name, local_dir="./index"):
|
|
| 36 |
load_from_azure("blobcontaineravatarbot")
|
| 37 |
|
| 38 |
# Load into FAISS
|
| 39 |
-
from langchain_community.embeddings import HuggingFaceEmbeddings # deprecated
|
| 40 |
-
|
| 41 |
|
| 42 |
embedding_model = HuggingFaceEmbeddings(
|
| 43 |
model_name="intfloat/e5-base-v2",
|
| 44 |
# multi_process=True,
|
| 45 |
-
model_kwargs={"device": "
|
| 46 |
encode_kwargs={"normalize_embeddings": True}, # Set `True` for cosine similarity
|
| 47 |
)
|
| 48 |
|
|
|
|
| 36 |
load_from_azure("blobcontaineravatarbot")
|
| 37 |
|
| 38 |
# Load into FAISS
|
| 39 |
+
# from langchain_community.embeddings import HuggingFaceEmbeddings # deprecated
|
| 40 |
+
from langchain_huggingface import HuggingFaceEmbeddings
|
| 41 |
|
| 42 |
embedding_model = HuggingFaceEmbeddings(
|
| 43 |
model_name="intfloat/e5-base-v2",
|
| 44 |
# multi_process=True,
|
| 45 |
+
model_kwargs={"device": "cuda"}, # use cuda for faster embeddings on nbidia GPUs
|
| 46 |
encode_kwargs={"normalize_embeddings": True}, # Set `True` for cosine similarity
|
| 47 |
)
|
| 48 |
|