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

fix: unify token_limit property #1071

Merged
merged 8 commits into from
Oct 18, 2024
Merged

fix: unify token_limit property #1071

merged 8 commits into from
Oct 18, 2024

Conversation

Wendong-Fan
Copy link
Member

@Wendong-Fan Wendong-Fan commented Oct 17, 2024

Description

if string value is passed to model_type when calling commercial model platforms like Mistral then the token_limit value would missing

also update OPENAI_COMPATIBLE_MODEL example and doc

Motivation and Context

  • I have raised an issue to propose this change (required for new features and bug fixes)

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds core functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (update in the documentation)
  • Example (update in the folder of example)

Implemented Tasks

  • Subtask 1
  • Subtask 2
  • Subtask 3

Checklist

Go over all the following points, and put an x in all the boxes that apply.
If you are unsure about any of these, don't hesitate to ask. We are here to help!

  • I have read the CONTRIBUTION guide. (required)
  • My change requires a change to the documentation.
  • I have updated the tests accordingly. (required for a bug fix or a new feature)
  • I have updated the documentation accordingly.

@Wendong-Fan Wendong-Fan self-assigned this Oct 17, 2024
@Wendong-Fan Wendong-Fan added this to the Sprint 14 milestone Oct 17, 2024
@Wendong-Fan Wendong-Fan added the bug Something isn't working label Oct 17, 2024
@Wendong-Fan Wendong-Fan marked this pull request as ready for review October 17, 2024 17:26
@WHALEEYE
Copy link
Collaborator

Do you think it's better to directly move the default value of token limit (4096) to the token_limit property of UnifiedModelType?

@Wendong-Fan
Copy link
Member Author

Do you think it's better to directly move the default value of token limit (4096) to the token_limit property of UnifiedModelType?

If we move this under UnifiedModelType then it would be hard for us to give warming to user, I feel it would be better to put under BaseModel

@WHALEEYE
Copy link
Collaborator

I feel like it's okay to give warning in the UnifiedModelType, as the token_limit inside is a pre-set default value, and it will only be called when a user tries to get token limit for an unrecognized str

@Wendong-Fan
Copy link
Member Author

I feel like it's okay to give warning in the UnifiedModelType, as the token_limit inside is a pre-set default value, and it will only be called when a user tries to get token limit for an unrecognized str

what is user passed an unrecognized str but set the token value in model_config_dict?

@WHALEEYE
Copy link
Collaborator

Then In our code I think the token_limit property will not be accessed given that the value in config dict is not None?

@Wendong-Fan
Copy link
Member Author

@WHALEEYE updated

@lightaime
Copy link
Member

Is 4096 too small for most of the model now? Should we just change it to large?

@lightaime
Copy link
Member

Should we set it to a very large number instead?

@Wendong-Fan
Copy link
Member Author

Should we set it to a very large number instead?

great point, updated

@Wendong-Fan Wendong-Fan linked an issue Oct 18, 2024 that may be closed by this pull request
3 tasks
@Wendong-Fan Wendong-Fan merged commit c66fde5 into master Oct 18, 2024
5 of 6 checks passed
@Wendong-Fan Wendong-Fan deleted the token_fix branch October 18, 2024 15:56
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
Status: No status
Development

Successfully merging this pull request may close these issues.

[BUG] TypeError: '<=' not supported between instances of 'int' and 'NotGiven'
3 participants