Skip to content

[fix] Handle None value for max_out_len parameter in HuggingFace model#2271

Open
Nexround wants to merge 1 commit intoopen-compass:mainfrom
Nexround:fix-max-out-len
Open

[fix] Handle None value for max_out_len parameter in HuggingFace model#2271
Nexround wants to merge 1 commit intoopen-compass:mainfrom
Nexround:fix-max-out-len

Conversation

@Nexround
Copy link

solving issue: #2270

…ce model

- Fix TypeError when max_out_len is None in arithmetic operations
- Add proper None checking in _single_generate and _batch_generate methods
- Use default values: 0 for max_length calculations, 512 for max_new_tokens
- Update type annotations from int to Optional[int] for max_out_len parameter
- Update docstrings to reflect the Optional[int] type change

Fixes: TypeError: unsupported operand type(s) for 'int' and 'NoneType'
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

Successfully merging this pull request may close these issues.

2 participants