1
0
Fork 0
onnx-web/api/tests/helpers.py

27 lines
746 B
Python
Raw Normal View History

from os import path
2023-09-26 02:57:25 +00:00
from typing import List
from unittest import skipUnless
2023-09-26 02:57:25 +00:00
from onnx_web.params import DeviceParams
2023-09-26 02:57:25 +00:00
def test_needs_models(models: List[str]):
2023-11-20 05:18:57 +00:00
return skipUnless(
all([path.exists(model) for model in models]), "model does not exist"
)
2023-11-23 17:19:58 +00:00
def test_needs_onnx_models(models: List[str]):
return skipUnless(
all([path.exists(f"{model}.onnx") for model in models]), "model does not exist"
)
def test_device() -> DeviceParams:
2023-11-20 05:18:57 +00:00
return DeviceParams("cpu", "CPUExecutionProvider")
2023-11-22 01:11:04 +00:00
TEST_MODEL_CORRECTION_CODEFORMER = "../models/.cache/correction-codeformer.pth"
TEST_MODEL_DIFFUSION_SD15 = "../models/stable-diffusion-onnx-v1-5"
TEST_MODEL_UPSCALING_SWINIR = "../models/.cache/upscaling-swinir.pth"