mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-12 13:42:23 +00:00
fix: num_gpus referenced error for mps + cpu
This commit is contained in:
parent
c8930c84a0
commit
d67a6a642a
@ -115,6 +115,10 @@ class ModelLoader(metaclass=Singleton):
|
|||||||
def huggingface_loader(llm_adapter: BaseLLMAdaper, model_params: ModelParams):
|
def huggingface_loader(llm_adapter: BaseLLMAdaper, model_params: ModelParams):
|
||||||
device = model_params.device
|
device = model_params.device
|
||||||
max_memory = None
|
max_memory = None
|
||||||
|
|
||||||
|
# if device is cpu or mps. gpu need to be zero
|
||||||
|
num_gpus = 0
|
||||||
|
|
||||||
if device == "cpu":
|
if device == "cpu":
|
||||||
kwargs = {"torch_dtype": torch.float32}
|
kwargs = {"torch_dtype": torch.float32}
|
||||||
elif device == "cuda":
|
elif device == "cuda":
|
||||||
|
Loading…
Reference in New Issue
Block a user