diff --git a/api/onnx_web/convert/__main__.py b/api/onnx_web/convert/__main__.py index ad89ead7..98cc3b7a 100644 --- a/api/onnx_web/convert/__main__.py +++ b/api/onnx_web/convert/__main__.py @@ -157,8 +157,6 @@ def fetch_model( _filename, ext = path.splitext(ext) if ext is not None: cache_name = cache_name + ext - else: - cache_name = cache_name else: cache_name = f"{cache_name}.{format}" diff --git a/api/onnx_web/onnx/onnx_net.py b/api/onnx_web/onnx/onnx_net.py index a974aff4..036c5d0d 100644 --- a/api/onnx_web/onnx/onnx_net.py +++ b/api/onnx_web/onnx/onnx_net.py @@ -66,8 +66,8 @@ class OnnxNet: def half(self): return self - def load_state_dict(self, net, strict=True) -> None: + def load_state_dict(self, _net, strict=True) -> None: pass - def to(self, device): + def to(self, _device): return self diff --git a/api/onnx_web/server/static.py b/api/onnx_web/server/static.py index 9a67bf0e..72d46dc9 100644 --- a/api/onnx_web/server/static.py +++ b/api/onnx_web/server/static.py @@ -27,7 +27,7 @@ def output(context: ServerContext, filename: str): def register_static_routes( - app: Flask, context: ServerContext, pool: DevicePoolExecutor + app: Flask, context: ServerContext, _pool: DevicePoolExecutor ): return [ app.route("/")(wrap_route(index, context)), diff --git a/api/onnx_web/utils.py b/api/onnx_web/utils.py index 4755c0ee..c0ae4c00 100644 --- a/api/onnx_web/utils.py +++ b/api/onnx_web/utils.py @@ -121,7 +121,7 @@ def merge(a, b, path=None): elif a[key] == b[key]: pass # same leaf value else: - raise Exception("Conflict at %s" % ".".join(path + [str(key)])) + raise ValueError("conflict at %s" % ".".join(path + [str(key)])) else: a[key] = b[key] return a diff --git a/api/scripts/test-release.py b/api/scripts/test-release.py index 894dbd61..c6573ebf 100644 --- a/api/scripts/test-release.py +++ b/api/scripts/test-release.py @@ -341,7 +341,7 @@ def main(): else: logger.warning("test failed: %s", test.name) failed.append(test.name) - except Exception as e: + except Exception: logger.exception("error running test for %s", test.name) failed.append(test.name)