From 8bb76f1fee1afb841525de85c7897db30c1b3413 Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Sat, 9 Dec 2023 20:50:41 -0600 Subject: [PATCH] keep protocol when downloading from http sources --- api/onnx_web/convert/client/http.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/api/onnx_web/convert/client/http.py b/api/onnx_web/convert/client/http.py index 9d9f840c..90a5e659 100644 --- a/api/onnx_web/convert/client/http.py +++ b/api/onnx_web/convert/client/http.py @@ -27,7 +27,7 @@ class HttpClient(BaseClient): self, conversion: ConversionContext, name: str, - uri: str, + source: str, format: Optional[str] = None, dest: Optional[str] = None, **kwargs, @@ -43,11 +43,9 @@ class HttpClient(BaseClient): if cached: return cached - if uri.startswith(HttpClient.protocol): - source = remove_prefix(uri, HttpClient.protocol) + if source.startswith(HttpClient.protocol): logger.info("downloading model from: %s", source) - elif uri.startswith(HttpClient.insecure_protocol): - source = remove_prefix(uri, HttpClient.insecure_protocol) + elif source.startswith(HttpClient.insecure_protocol): logger.warning("downloading model from insecure source: %s", source) return download_progress(source, cache_paths[0])