keep protocol when downloading from http sources
This commit is contained in:
parent
4c5bb906e8
commit
8bb76f1fee
|
@ -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])
|
||||||
|
|
Loading…
Reference in New Issue