diff --git a/config.yaml b/config.yaml index 55e1eea..7257d4a 100644 --- a/config.yaml +++ b/config.yaml @@ -18,7 +18,7 @@ llm: - id: guard_model type: guard file: models/guard_model - load: {device: cuda} + load: {device: cpu} limits: max_input_tokens: 4096 max_new_tokens: 32 diff --git a/middleware/llm_worker.py b/middleware/llm_worker.py index 74be7b2..b6d4eb2 100644 --- a/middleware/llm_worker.py +++ b/middleware/llm_worker.py @@ -27,11 +27,11 @@ def guard_worker_main( ) stage = "load_model" dtype_name = load.get("dtype", "auto") - torch_dtype = "auto" if dtype_name == "auto" else getattr(torch, dtype_name) + dtype = "auto" if dtype_name == "auto" else getattr(torch, dtype_name) device = load.get("device", "cpu") model = AutoModelForCausalLM.from_pretrained( model_path, - torch_dtype=torch_dtype, + dtype=dtype, **hub_options, ) stage = "move_to_device"