Repository navigation
feat(huggingface_hub): Set request parameters (#7993) - #8061
Open
ansh-rohilla wants to merge 2 commits into
Open
ansh-rohilla wants to merge 2 commits into
ansh-rohilla wants to merge 2 commits into
Conversation
Record gen_ai.request configuration attributes when available in huggingface_hub. - Add seed to attribute_mapping for gen_ai.request.seed - Support max_new_tokens for gen_ai.request.max_tokens in text_generation - Fall back to extra_body dict if parameters are provided there - Add unit tests for request parameters in text_generation and chat_completion Resolves getsentry#7993 Resolves PY-2977
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6e2a6a7. Configure here.
Only pass extra_body and assert top_k in chat_completion when HF_VERSION >= 0.29.0.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Record
gen_ai.requestconfiguration attributes when available inhuggingface_hubrequests, as requested in issue #7993.Key changes:
seedtoattribute_mappingmapping toSPANDATA.GEN_AI_REQUEST_SEED.max_new_tokensforSPANDATA.GEN_AI_REQUEST_MAX_TOKENSwhenmax_tokensis not explicitly set (such as inInferenceClient.text_generation).extra_bodydict when provided.tests/integrations/huggingface_hub/test_huggingface_hub.pyfor bothtext_generationandchat_completion, covering provided attributes, zero-value attributes, and omitted/None attributes across streaming and static lifecycle configurations.Issues
huggingface_hub: Set request parameters #7993