Skip to content

Commit

Permalink
Update _torchscript_model_adapter.py
Browse files Browse the repository at this point in the history
converting the input to the model to float to avoid numpy array errors
  • Loading branch information
esgomezm authored Jul 31, 2024
1 parent 9e1e1fe commit 37734cc
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def forward(self, *batch: Optional[Tensor]) -> List[Optional[Tensor]]:
assert torch is not None
with torch.no_grad():
torch_tensor = [
None if b is None else torch.from_numpy(b.data.data).to(self.devices[0])
None if b is None else torch.from_numpy(b.data.data.astype("float32")).to(self.devices[0])
for b in batch
]
_result: Union[ # pyright: ignore[reportUnknownVariableType]
Expand Down

0 comments on commit 37734cc

Please sign in to comment.