chore: set default context length to 2048 (#2776)

Co-authored-by: James <james@jan.ai>
This commit is contained in:
NamH 2024-04-22 19:57:00 +07:00 committed by GitHub
parent 252858743a
commit 83e9e2b80a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View File

@ -853,7 +853,7 @@ export default class JanModelExtension extends ModelExtension {
if (config.max_sequence_length) return config.max_sequence_length if (config.max_sequence_length) return config.max_sequence_length
if (config.max_position_embeddings) return config.max_position_embeddings if (config.max_position_embeddings) return config.max_position_embeddings
if (config.n_ctx) return config.n_ctx if (config.n_ctx) return config.n_ctx
return 4096 return 2048
} }
/** /**
@ -883,7 +883,7 @@ export default class JanModelExtension extends ModelExtension {
} catch (err) { } catch (err) {
log(`[Conversion]::Debug: Error using hf-to-gguf.py, trying convert.py`) log(`[Conversion]::Debug: Error using hf-to-gguf.py, trying convert.py`)
let ctx = 4096 let ctx = 2048
try { try {
const config = await fs.readFileSync( const config = await fs.readFileSync(
await joinPath([modelDirPath, 'config.json']), await joinPath([modelDirPath, 'config.json']),

View File

@ -36,7 +36,7 @@ export const presetConfiguration: Record<string, SettingComponentProps> = {
min: 0, min: 0,
max: 4096, max: 4096,
step: 128, step: 128,
value: 4096, value: 2048,
}, },
requireModelReload: true, requireModelReload: true,
configType: 'setting', configType: 'setting',

View File

@ -31,7 +31,7 @@ export const getConfigurationsData = (
componentSetting.controllerProps.max = componentSetting.controllerProps.max =
selectedModel?.settings.ctx_len || selectedModel?.settings.ctx_len ||
componentSetting.controllerProps.max || componentSetting.controllerProps.max ||
4096 2048
break break
} }
} }