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: context length is reset while creating a new thread #4294

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

louis-jan
Copy link
Contributor

@louis-jan louis-jan commented Dec 18, 2024

Describe Your Changes

  • Fixed an issue where app resets context length setting while creating a new thread due to undefined model selection value. Now should use default model value.

CleanShot 2024-12-18 at 17 52 41

Fixes Issues

  • Closes #
  • Closes #

Code changes

The Git diff shows the following changes to the useCreateNewThread.ts file:

  1. Variable Renaming:

    • The variable model is renamed to defaultModel. This change ensures that the function uses the default model settings consistently.
  2. Consistent Use of Default Model:

    • In both overriddenSettings and overriddenParameters, the code now checks if the engine of defaultModel is local using !isLocalEngine(defaultModel?.engine). This ensures that the settings are applied based on whether the model's engine is local or not, maintaining consistency.
  3. Token Limit Adjustment:

    • The token limit in overriddenParameters now correctly uses defaultModel?.parameters.token_limit ?? 8192. This means that if token_limit is not defined for defaultModel, it defaults to 8192.

These changes make the code more consistent and clear, ensuring that model-specific settings are applied correctly based on whether the engine is local or not.

@louis-jan louis-jan requested a review from urmauur December 18, 2024 10:44
@github-actions github-actions bot added the type: bug Something isn't working label Dec 18, 2024
Copy link
Contributor

This is the build for this pull request. You can download it from the Artifacts section here: Build URL.

Copy link
Contributor

Barecheck - Code coverage report

Total: 69.09%

Your code coverage diff: 0.00% ▴

Uncovered files and lines
FileLines
web/hooks/useCreateNewThread.ts43, 45, 50-51, 54-55, 160-161, 163-164, 171-172, 183, 192, 227, 230

@louis-jan louis-jan merged commit 9c5bda7 into dev Dec 19, 2024
21 checks passed
@louis-jan louis-jan deleted the fix/context-length-is-reset-on-thread-create branch December 19, 2024 03:02
@github-actions github-actions bot added this to the v0.5.12 milestone Dec 19, 2024
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