Spaces:
Paused
Paused
update cuda
Browse files
app.py
CHANGED
@@ -25,8 +25,8 @@ from langchain_community.document_loaders import DirectoryLoader
|
|
25 |
|
26 |
# Initialize embeddings and ChromaDB
|
27 |
model_name = "sentence-transformers/all-mpnet-base-v2"
|
28 |
-
|
29 |
-
device = "cuda"
|
30 |
model_kwargs = {"device": device}
|
31 |
embeddings = HuggingFaceEmbeddings(model_name=model_name, model_kwargs=model_kwargs)
|
32 |
|
|
|
25 |
|
26 |
# Initialize embeddings and ChromaDB
|
27 |
model_name = "sentence-transformers/all-mpnet-base-v2"
|
28 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
29 |
+
# device = "cuda"
|
30 |
model_kwargs = {"device": device}
|
31 |
embeddings = HuggingFaceEmbeddings(model_name=model_name, model_kwargs=model_kwargs)
|
32 |
|