2023-09-28 23:45:04 +00:00
|
|
|
from os import path
|
2023-09-26 02:57:25 +00:00
|
|
|
from typing import List
|
2023-09-28 23:45:04 +00:00
|
|
|
from unittest import skipUnless
|
2023-09-26 02:57:25 +00:00
|
|
|
|
2023-09-28 23:45:04 +00:00
|
|
|
from onnx_web.params import DeviceParams
|
2023-09-26 02:57:25 +00:00
|
|
|
|
|
|
|
|
2023-09-28 23:45:04 +00:00
|
|
|
def test_needs_models(models: List[str]):
|
|
|
|
return skipUnless(all([path.exists(model) for model in models]), "model does not exist")
|
|
|
|
|
|
|
|
|
|
|
|
def test_device() -> DeviceParams:
|
|
|
|
return DeviceParams("cpu", "CPUExecutionProvider")
|
|
|
|
|
|
|
|
|
2023-10-07 00:04:48 +00:00
|
|
|
TEST_MODEL_DIFFUSION_SD15 = "../models/stable-diffusion-onnx-v1-5"
|
|
|
|
TEST_MODEL_UPSCALING_SWINIR = "../models/.cache/upscaling-swinir.pth"
|