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

chore: set default context length to 2048 #2776

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions extensions/model-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ export default class JanModelExtension extends ModelExtension {
if (config.max_sequence_length) return config.max_sequence_length
if (config.max_position_embeddings) return config.max_position_embeddings
if (config.n_ctx) return config.n_ctx
return 4096
return 2048
}

/**
Expand Down Expand Up @@ -883,7 +883,7 @@ export default class JanModelExtension extends ModelExtension {
} catch (err) {
log(`[Conversion]::Debug: Error using hf-to-gguf.py, trying convert.py`)

let ctx = 4096
let ctx = 2048
try {
const config = await fs.readFileSync(
await joinPath([modelDirPath, 'config.json']),
Expand Down
2 changes: 1 addition & 1 deletion web/screens/Chat/ModelSetting/predefinedComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const presetConfiguration: Record<string, SettingComponentProps> = {
min: 0,
max: 4096,
step: 128,
value: 4096,
value: 2048,
},
requireModelReload: true,
configType: 'setting',
Expand Down
2 changes: 1 addition & 1 deletion web/utils/componentSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const getConfigurationsData = (
componentSetting.controllerProps.max =
selectedModel?.settings.ctx_len ||
componentSetting.controllerProps.max ||
4096
2048
break
}
}
Expand Down
Loading