mirror of
https://github.com/trycua/lume.git
synced 2026-05-03 18:50:37 -05:00
Move inputs to model's same device, previously hardcoded to CUDA
This commit is contained in:
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user