Skip to content

fix: correct get_context_length default fallback behavior#4861

Open
Ricardo-M-L wants to merge 1 commit intoxorbitsai:mainfrom
Ricardo-M-L:inference-fix-fallback
Open

fix: correct get_context_length default fallback behavior#4861
Ricardo-M-L wants to merge 1 commit intoxorbitsai:mainfrom
Ricardo-M-L:inference-fix-fallback

Conversation

@Ricardo-M-L
Copy link
Copy Markdown
Contributor

Summary

Correct get_context_length default fallback behavior to properly handle cases where context length is not explicitly set.

🤖 Generated with Claude Code

When all config attributes (max_sequence_length, seq_length,
max_position_embeddings) are None, the function incorrectly returned
2048 even though max() with all None values would raise ValueError.
Now uses a generator expression with default parameter to properly
handle the case where no values are available.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@XprobeBot XprobeBot added the bug Something isn't working label Apr 27, 2026
@XprobeBot XprobeBot added this to the v2.x milestone Apr 27, 2026
@qinxuye
Copy link
Copy Markdown
Contributor

qinxuye commented Apr 27, 2026

There is conflict, please resolve it.

@qinxuye
Copy link
Copy Markdown
Contributor

qinxuye commented Apr 29, 2026

This logic has been modified in #4768

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants