diff --git a/src/transformers/tools/agents.py b/src/transformers/tools/agents.py index fdbae381f4ec1e..226fe735abf8e7 100644 --- a/src/transformers/tools/agents.py +++ b/src/transformers/tools/agents.py @@ -725,7 +725,7 @@ def from_pretrained(cls, pretrained_model_name_or_path, **kwargs): def _model_device(self): if hasattr(self.model, "hf_device_map"): return list(self.model.hf_device_map.values())[0] - for param in self.mode.parameters(): + for param in self.model.parameters(): return param.device def generate_one(self, prompt, stop):