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: 4209 - Inconsistent max tokens value persistence #4213

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

louis-jan
Copy link
Contributor

Describe Your Changes

This PR addresses an issue where selecting the max_tokens parameter in the thread.json file doesn’t get updated when the model is changed.

CleanShot 2024-12-04 at 12 35 38

Fixes Issues

Changes made

The code change involves adjustments to how model parameters are handled in two different files: ModelDropdown/index.tsx and useCreateNewThread.ts.

  1. ModelDropdown/index.tsx Changes:

    • The overriddenSettings logic is replaced with overriddenParameters.
    • A new defaultContextLength variable is defined, which chooses the minimum between 8192 and the model's ctx_len setting (defaulting to 8192 if not specified).
    • The overriddenParameters object now includes both ctx_len and max_tokens, both set to this new defaultContextLength.
  2. useCreateNewThread.ts Changes:

    • Similar to the changes in ModelDropdown, a defaultContextLength variable is introduced.
    • The overriddenSettings object now consistently uses this defaultContextLength for ctx_len.
    • The overriddenParameters object is reconstructed to set max_tokens using the same defaultContextLength.

Overall, the changes standardize how ctx_len and max_tokens are determined and used, defaulting these settings to a maximum of 8192.

@github-actions github-actions bot added the type: bug Something isn't working label Dec 4, 2024
Copy link
Contributor

github-actions bot commented Dec 4, 2024

Barecheck - Code coverage report

Total: 69.29%

Your code coverage diff: 0.00% ▴

Uncovered files and lines
FileLines
web/containers/ModelDropdown/index.tsx102, 113, 123-124, 127, 129-130, 132-133, 135-138, 140, 148, 165-167, 169, 171, 190, 194, 199, 206, 209-210, 245-247, 251, 275-277, 279, 283, 286-291, 298-299, 310, 314, 332, 348, 369, 378, 384, 392-393, 396-401, 404, 407, 459-460, 462, 488, 496, 498, 523, 528-529, 531, 535-537, 539-540, 542, 552-555, 583, 591, 593
web/hooks/useCreateNewThread.ts42, 44, 49-50, 53-54

@louis-jan louis-jan requested a review from a team December 4, 2024 06:12
@louis-jan louis-jan merged commit 6557d64 into dev Dec 4, 2024
11 checks passed
@louis-jan louis-jan deleted the fix/4209-inconsistent-max-tokens-value-persistence branch December 4, 2024 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants