mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
onnx cpu-only torch fix
This commit is contained in:
@@ -19,6 +19,11 @@ def extract_device(args: List, kwargs: Dict):
|
||||
|
||||
|
||||
def move_inference_session(session: ort.InferenceSession, device: torch.device):
|
||||
from modules.devices import device as default_device
|
||||
|
||||
if default_device.type == "cpu": # CPU-only torch without any other external ops overriding. This transfer will be led to mistake.
|
||||
return session
|
||||
|
||||
from . import DynamicSessionOptions, TemporalModule
|
||||
from .execution_providers import TORCH_DEVICE_TO_EP
|
||||
|
||||
|
||||
Reference in New Issue
Block a user