From 48f42e56fe1bcf495f7dfe4062330d83e486f664 Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Tue, 10 Jan 2023 20:46:17 -0600 Subject: [PATCH] fix(api): rename to avoid shadowing type --- api/onnx_web/serve.py | 6 +++--- onnx-web.code-workspace | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/api/onnx_web/serve.py b/api/onnx_web/serve.py index 9f46400f..022ed222 100644 --- a/api/onnx_web/serve.py +++ b/api/onnx_web/serve.py @@ -148,9 +148,9 @@ def json_with_cors(data, origin='*'): return res -def make_output_path(type: str, seed: int, params: Tuple[Union[str, int, float]]): +def make_output_path(mode: str, seed: int, params: Tuple[Union[str, int, float]]): sha = sha256() - sha.update(type.encode('utf-8')) + sha.update(mode.encode('utf-8')) for param in params: if isinstance(param, str): sha.update(param.encode('utf-8')) @@ -161,7 +161,7 @@ def make_output_path(type: str, seed: int, params: Tuple[Union[str, int, float]] else: print('cannot hash param: %s, %s' % (param, type(param))) - output_file = '%s_%s_%s.png' % (type, seed, sha.hexdigest()) + output_file = '%s_%s_%s.png' % (mode, seed, sha.hexdigest()) output_full = safer_join(output_path, output_file) return (output_file, output_full) diff --git a/onnx-web.code-workspace b/onnx-web.code-workspace index 3cd3df78..1f5a39af 100644 --- a/onnx-web.code-workspace +++ b/onnx-web.code-workspace @@ -30,6 +30,7 @@ "numpy", "Onnx", "onnxruntime", + "outpaint", "pndm", "pretrained", "protobuf",