Skip to content

WithBaseURL should include Path #240

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

Closed
BimDav opened this issue Feb 26, 2025 · 2 comments
Closed

WithBaseURL should include Path #240

BimDav opened this issue Feb 26, 2025 · 2 comments

Comments

@BimDav
Copy link

BimDav commented Feb 26, 2025

Describe the bug
At the moment WithBaseURL only includes the Host part of the URL, so that giving it this kind of URL: https://api-inference.huggingface.co/v1 is not possible as it will remove the /v1 part.

To Reproduce
Use a URL with non empty Path in WithBaseURL

Expected behavior
The base URL for calls in this case should be https://api-inference.huggingface.co/v1, not https://api-inference.huggingface.co

Additional context
This enables compatibility for example with HuggingFace https://huggingface.co/docs/api-inference/tasks/image-text-to-text?code=python (openAI example at the bottom), but also probably with plenty of APIs that use this kind of versioning.

@qanghaa
Copy link

qanghaa commented Mar 2, 2025

Just add / to suffix
in your case; it exactly is https://api-inference.huggingface.co/v1/
And it should work because I've got the same issue

@BimDav BimDav closed this as completed Mar 11, 2025
@daulet
Copy link

daulet commented Mar 14, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants