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.
I'm using
huggingface.chatCompletionand need to be able to provide some cookies to theInferenceClient. I don't see a way to pass that in viacreate(), which is where the client is instantiated. I also looked at thehuggingface_hubimplementation, 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_argsdictionary, similar tohuggingface.api_keyand.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.