File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -185,11 +185,6 @@ def repo_type_and_id_from_hf_id(hf_id: str, hub_url: Optional[str] = None) -> Tu
185185 """
186186 input_hf_id = hf_id
187187
188- # check if a proxy has been set => if yes, update the returned URL to use the proxy
189- if ENDPOINT not in (_HF_DEFAULT_ENDPOINT , _HF_DEFAULT_STAGING_ENDPOINT ):
190- hf_id = hf_id .replace (_HF_DEFAULT_ENDPOINT , ENDPOINT )
191- hf_id = hf_id .replace (_HF_DEFAULT_STAGING_ENDPOINT , ENDPOINT )
192-
193188 hub_url = re .sub (r"https?://" , "" , hub_url if hub_url is not None else ENDPOINT )
194189 is_hf_url = hub_url in hf_id and "@" not in hf_id
195190
@@ -436,6 +431,11 @@ class RepoUrl(str):
436431 """
437432
438433 def __new__ (cls , url : Any , endpoint : Optional [str ] = None ):
434+ # check if a proxy has been set => if yes, update the returned URL to use the proxy
435+ if ENDPOINT not in (_HF_DEFAULT_ENDPOINT , _HF_DEFAULT_STAGING_ENDPOINT ):
436+ url = url .replace (_HF_DEFAULT_ENDPOINT , ENDPOINT )
437+ url = url .replace (_HF_DEFAULT_STAGING_ENDPOINT , ENDPOINT )
438+
439439 return super (RepoUrl , cls ).__new__ (cls , url )
440440
441441 def __init__ (self , url : Any , endpoint : Optional [str ] = None ) -> None :
You can’t perform that action at this time.
0 commit comments