-
Notifications
You must be signed in to change notification settings - Fork 629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HfApi.endpoint
should be configurable in Repository
#808
Comments
@SBrandeis could you please explain further what the usecase is, and share a bit of code which would use the arguments? It helps with designing the API. |
I'm using My local version of AutoTrain uses a local version of the HF Hub to store and manipulate repos. The URL of the local HF Hub is not Currently import os
import huggingface_hub
# I have to override ENDPOINT
HF_HUB_URL = "http://localhost:PORT"
huggingface_hub.constants.ENDPOINT = HF_HUB_URL
huggingface_hub.hf_api.ENDPOINT = HF_HUB_URL
huggingface_hub.repository.ENDPOINT = HF_HUB_URL
# Even worse:
clone_url = f"http://user:{hf_token}@{HF_HUB_URL[len('http://'):]}/datasets/user/dataset_name"
repo = huggingface_hub.Repository(local_dir=".", clone_from=clone_url, use_auth_token=hf_token) I would like to be able to configure the URL of the HF Hub when using |
I'm happy to open a PR if it makes sense to add this to the library |
It's a reasonable asumption which would also unblock on-prem efforts as seen in #650 and huggingface/transformers#15514 |
Related to #798 |
Looks quite reasonable to me. Happy to review the PR if you're kind enough to open one @SBrandeis :) |
huggingface_hub/src/huggingface_hub/repository.py
Line 434 in c2ffc48
We should be able to pass arguments to
HfApi()
fromRepository
The text was updated successfully, but these errors were encountered: