mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Check for response ok
This commit is contained in:
@ -1249,18 +1249,20 @@ async function getStatusTextgen() {
|
||||
}),
|
||||
});
|
||||
|
||||
const data = await response.json();
|
||||
if (data) {
|
||||
const { chat_template, chat_template_hash } = data;
|
||||
console.log(`We have chat template ${chat_template.split('\n')[0]}...`);
|
||||
const templates = await deriveTemplatesFromChatTemplate(chat_template, chat_template_hash);
|
||||
if (templates) {
|
||||
const { context, instruct } = templates;
|
||||
if (wantsContextDerivation) {
|
||||
selectContextPreset(context, { isAuto: true });
|
||||
}
|
||||
if (wantsInstructDerivation) {
|
||||
selectInstructPreset(instruct, { isAuto: true });
|
||||
if (response.ok) {
|
||||
const data = await response.json();
|
||||
if (data) {
|
||||
const { chat_template, chat_template_hash } = data;
|
||||
console.log(`We have chat template ${chat_template.split('\n')[0]}...`);
|
||||
const templates = await deriveTemplatesFromChatTemplate(chat_template, chat_template_hash);
|
||||
if (templates) {
|
||||
const { context, instruct } = templates;
|
||||
if (wantsContextDerivation) {
|
||||
selectContextPreset(context, { isAuto: true });
|
||||
}
|
||||
if (wantsInstructDerivation) {
|
||||
selectInstructPreset(instruct, { isAuto: true });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user