feat: support env var DEFAULT_INPUT_TEMPLATE to custom default template for preprocessing user inputs

This commit is contained in:
Dean-YZG 2024-05-13 17:11:35 +08:00
parent 2d1f0c9f57
commit 9d7ce207b6
1 changed files with 7 additions and 0 deletions

View File

@ -164,6 +164,13 @@ export const useAppConfig = createPersistStore(
state.lastUpdate = Date.now(); state.lastUpdate = Date.now();
} }
if (version < 3.9) {
state.modelConfig.template =
state.modelConfig.template !== DEFAULT_INPUT_TEMPLATE
? state.modelConfig.template
: config?.template ?? DEFAULT_INPUT_TEMPLATE;
}
return state as any; return state as any;
}, },
}, },