move initialization of onnx pipelines & create onnx folder automatically

This commit is contained in:
Seunghoon Lee
2024-02-02 05:20:46 +09:00
parent a4e1fc7b31
commit fcf00bd854
3 changed files with 8 additions and 3 deletions
+6
View File
@@ -1,3 +1,4 @@
import os
from typing import Any, Dict, Optional
import torch
import diffusers
@@ -142,9 +143,14 @@ def initialize():
return
from modules import devices
from modules.paths import models_path
from . import pipelines
from .execution_providers import ExecutionProvider, TORCH_DEVICE_TO_EP
onnx_dir = os.path.join(models_path, "ONNX")
if not os.path.isdir(onnx_dir):
os.mkdir(onnx_dir)
if devices.backend == "rocm":
TORCH_DEVICE_TO_EP["cuda"] = ExecutionProvider.ROCm