1
0
Fork 0

keep protocol when downloading from http sources

This commit is contained in:
Sean Sube 2023-12-09 20:50:41 -06:00
parent 4c5bb906e8
commit 8bb76f1fee
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 3 additions and 5 deletions

View File

@ -27,7 +27,7 @@ class HttpClient(BaseClient):
self, self,
conversion: ConversionContext, conversion: ConversionContext,
name: str, name: str,
uri: str, source: str,
format: Optional[str] = None, format: Optional[str] = None,
dest: Optional[str] = None, dest: Optional[str] = None,
**kwargs, **kwargs,
@ -43,11 +43,9 @@ class HttpClient(BaseClient):
if cached: if cached:
return cached return cached
if uri.startswith(HttpClient.protocol): if source.startswith(HttpClient.protocol):
source = remove_prefix(uri, HttpClient.protocol)
logger.info("downloading model from: %s", source) logger.info("downloading model from: %s", source)
elif uri.startswith(HttpClient.insecure_protocol): elif source.startswith(HttpClient.insecure_protocol):
source = remove_prefix(uri, HttpClient.insecure_protocol)
logger.warning("downloading model from insecure source: %s", source) logger.warning("downloading model from insecure source: %s", source)
return download_progress(source, cache_paths[0]) return download_progress(source, cache_paths[0])