Skip to content

Commit

Permalink
chore: set default context length to 2048 (#2776)
Browse files Browse the repository at this point in the history
Co-authored-by: James <[email protected]>
  • Loading branch information
namchuai and James authored Apr 22, 2024
1 parent 2528587 commit 83e9e2b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
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

0 comments on commit 83e9e2b

Please sign in to comment.