Spaces:
Configuration error
Configuration error
oremaz
commited on
Commit
·
2e1a674
1
Parent(s):
9266c6c
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -99,12 +99,13 @@ code_llm = HuggingFaceLLM(
|
|
| 99 |
|
| 100 |
embed_model = HuggingFaceEmbedding(
|
| 101 |
model_name="llamaindex/vdr-2b-multi-v1",
|
| 102 |
-
device="cpu",
|
| 103 |
trust_remote_code=True,
|
| 104 |
model_kwargs={
|
| 105 |
-
"torch_dtype": torch.
|
| 106 |
-
"
|
| 107 |
-
}
|
|
|
|
| 108 |
|
| 109 |
Settings.llm = proj_llm
|
| 110 |
Settings.embed_model = embed_model
|
|
@@ -266,8 +267,8 @@ class DynamicQueryEngineManager:
|
|
| 266 |
top_n=3,
|
| 267 |
device="cpu",
|
| 268 |
model_kwargs={
|
| 269 |
-
"torch_dtype": torch.
|
| 270 |
-
"
|
| 271 |
}
|
| 272 |
)
|
| 273 |
def postprocess_nodes(self, nodes, query_bundle):
|
|
|
|
| 99 |
|
| 100 |
embed_model = HuggingFaceEmbedding(
|
| 101 |
model_name="llamaindex/vdr-2b-multi-v1",
|
| 102 |
+
device="cpu",
|
| 103 |
trust_remote_code=True,
|
| 104 |
model_kwargs={
|
| 105 |
+
"torch_dtype": torch.float32, # Use float32 for CPU
|
| 106 |
+
"low_cpu_mem_usage": True, # Still get memory optimization
|
| 107 |
+
}
|
| 108 |
+
)
|
| 109 |
|
| 110 |
Settings.llm = proj_llm
|
| 111 |
Settings.embed_model = embed_model
|
|
|
|
| 267 |
top_n=3,
|
| 268 |
device="cpu",
|
| 269 |
model_kwargs={
|
| 270 |
+
"torch_dtype": torch.float32, # Use float32 for CPU
|
| 271 |
+
"low_cpu_mem_usage": True, # Still get memory optimization
|
| 272 |
}
|
| 273 |
)
|
| 274 |
def postprocess_nodes(self, nodes, query_bundle):
|