mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-07-25 16:12:08 +08:00
Fix model_runner output to ensure tensor conversion to NumPy.
Updated the `run_model` method to explicitly convert tensor outputs to NumPy arrays using `.numpy()`. This ensures compatibility with downstream processes relying on NumPy array inputs.
This commit is contained in:
@@ -72,7 +72,7 @@ class TinyGradRunner(ModelRunner):
|
||||
return self.tensor_inputs
|
||||
|
||||
def run_model(self, inputs: dict[str, any]) -> np.ndarray:
|
||||
return self.model_run(**inputs).flatten()
|
||||
return self.model_run(**inputs).numpy().flatten()
|
||||
|
||||
|
||||
class ONNXRunner(ModelRunner):
|
||||
|
||||
Reference in New Issue
Block a user