Skip to content

Conversation

@kszucs
Copy link
Member

@kszucs kszucs commented Nov 19, 2025

Rationale for this change

Huggingface Private Hub may use custom endpoint, it is also useful for enabling open source projects to use https://hub-ci.huggingface.co for testing.

What changes are included in this PR?

Add support for configuring huggingface endpoint. If not provided, it tries to read from HF_ENDPOINT environment variable.

It also fixes a bug when passing revision which must be encoded, like refs/convert/parquet should be encoded as refs%2Fconvert%2Fparquet.

Are there any user-facing changes?

There is a new builder method called .endpoint().

@kszucs kszucs requested a review from Xuanwo as a code owner November 19, 2025 11:33
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. releases-note/feat The PR implements a new feature or has a title that begins with "feat" labels Nov 19, 2025
@kszucs
Copy link
Member Author

kszucs commented Nov 19, 2025

The produced URLs haven't been tested so I would need to mock the http client the assert on the created URLs, do you have an already established approach for that?

@Xuanwo
Copy link
Member

Xuanwo commented Nov 19, 2025

The produced URLs haven't been tested so I would need to mock the http client the assert on the created URLs, do you have an already established approach for that?

I think this change is simple enough to merge directly. Let's go.

Copy link
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 19, 2025
@Xuanwo Xuanwo merged commit 4d3cb2a into apache:main Nov 19, 2025
80 checks passed
@Xuanwo
Copy link
Member

Xuanwo commented Nov 19, 2025

it is also useful for enabling open source projects to use https://hub-ci.huggingface.co for testing.

We can set up another integration test for https://hub-ci.huggingface.co at https://github.com/apache/opendal/tree/main/.github/services/huggingface/huggingface.

Is this endpoint available for registration? I can help set up this test infra.

@kszucs
Copy link
Member Author

kszucs commented Nov 19, 2025

Thanks @Xuanwo for reviewing and merging!

it is also useful for enabling open source projects to use https://hub-ci.huggingface.co for testing.

We can set up another integration test for https://hub-ci.huggingface.co at https://github.com/apache/opendal/tree/main/.github/services/huggingface/huggingface.

Is this endpoint available for registration? I can help set up this test infra.

Yes. @lhoestq can provide more context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer releases-note/feat The PR implements a new feature or has a title that begins with "feat" size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants