Move inputs to model's same device, previously hardcoded to CUDA

This commit is contained in:
cgutierr
2025-08-03 13:02:15 +02:00
parent 5b5f17af8e
commit 9781810451
@@ -141,8 +141,7 @@ class HuggingFaceLocalAdapter(CustomLLM):
)
# Move inputs to the same device as model
if torch.cuda.is_available() and self.device != "cpu":
inputs = inputs.to("cuda")
inputs = inputs.to(model.device)
# Generate response
with torch.no_grad():