Fix TogetherAI models list

74addf1241e7c64f5608211770b2f97c3c0e2b93

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +8 -8Showing whitespace changes
public/scripts/textgen-models.js+8 -8
@@ -130,11 +130,11 @@ export async function loadTogetherAIModels(data) {
130130 return;
131131 }
132132
133133 data.sort((a, b) => a.nameid.localeCompare(b.nameid));
134134 togetherModels = data;
135135
136136 if (!data.find(x => x.nameid === textgen_settings.togetherai_model)) {
137137 textgen_settings.togetherai_model = data[0]?.nameid || '';
138138 }
139139
140140 $('#model_togetherai_select').empty();
@@ -145,9 +145,9 @@ export async function loadTogetherAIModels(data) {
145145 }
146146
147147 const option = document.createElement('option');
148148 option.value = model.nameid;
149149 option.text = model.display_name;
150150 option.selected = model.nameid === textgen_settings.togetherai_model;
151151 $('#model_togetherai_select').append(option);
152152 }
153153}
@@ -592,7 +592,7 @@ function onTogetherModelSelect() {
592592 const modelName = String($('#model_togetherai_select').val());
593593 textgen_settings.togetherai_model = modelName;
594594 $('#api_button_textgenerationwebui').trigger('click');
595595 const model = togetherModels.find(x => x.nameid === modelName);
596596 setGenerationParamsFromPreset({ max_length: model.context_length });
597597}
598598
@@ -662,7 +662,7 @@ function getMancerModelTemplate(option) {
662662}
663663
664664function getTogetherModelTemplate(option) {
665665 const model = togetherModels.find(x => x.nameid === option?.element?.value);
666666
667667 if (!option.id || !model) {
668668 return option.text;
@@ -670,7 +670,7 @@ function getTogetherModelTemplate(option) {
670670
671671 return $((`
672672 <div class="flex-container flexFlowColumn">
673673 <div><strong>${DOMPurify.sanitize(model.nameid)}</strong> | <span>${model.context_length || '???'} tokens</span></div>
674674 <div><small>${DOMPurify.sanitize(model.description)}</small></div>
675675 </div>
676676 `));