Skip to content
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

Need to provide additional args to InferenceClient #44

Open
dylan-stark opened this issue Nov 2, 2023 · 2 comments
Open

Need to provide additional args to InferenceClient #44

dylan-stark opened this issue Nov 2, 2023 · 2 comments

Comments

@dylan-stark
Copy link

I'm using huggingface.chatCompletion and need to be able to provide some cookies to the InferenceClient. I don't see a way to pass that in via create(), which is where the client is instantiated. I also looked at the huggingface_hub implementation, but didn't see a way to set it via module member or environment variable.

The approach I landed on was adding a module-level client_args dictionary, similar to huggingface.api_key and .prompt_builder, and passing anything defined in there when the client is instantiated. If that makes sense and you want to support this, I'm happy to open a PR. Or if you see issues or have suggestions to improve, let me know.

@philschmid
Copy link
Owner

Hello @dylan-stark,

Currently there is no way to customize the InferenceClient.
If you want to can create a PR with a recommendation on how to add those.

@dylan-stark
Copy link
Author

Hi @philschmid. I opened PR #45. It's working well for me in practice. If there are some changes you'd recommend, I'm happy to make them.

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

2 participants