Add ollama download shortcut to vector storage

This commit is contained in:
Cohee 2024-06-22 16:38:00 +03:00
parent b448568aa3
commit b8830e34d3
2 changed files with 12 additions and 2 deletions

View File

@ -1502,6 +1502,13 @@ jQuery(async () => {
saveSettingsDebounced(); saveSettingsDebounced();
}); });
$('#vectors_ollama_pull').on('click', (e) => {
const presetModel = extension_settings.vectors.ollama_model || '';
e.preventDefault();
$('#ollama_download_model').trigger('click');
$('#dialogue_popup_input').val(presetModel);
});
const validSecret = !!secret_state[SECRET_KEYS.NOMICAI]; const validSecret = !!secret_state[SECRET_KEYS.NOMICAI];
const placeholder = validSecret ? '✔️ Key saved' : '❌ Missing key'; const placeholder = validSecret ? '✔️ Key saved' : '❌ Missing key';
$('#api_key_nomicai').attr('placeholder', placeholder); $('#api_key_nomicai').attr('placeholder', placeholder);

View File

@ -32,8 +32,11 @@
<input id="vectors_ollama_keep" type="checkbox" /> <input id="vectors_ollama_keep" type="checkbox" />
<span data-i18n="Keep model in memory">Keep model in memory</span> <span data-i18n="Keep model in memory">Keep model in memory</span>
</label> </label>
<i data-i18n="Hint: Download models and set the URL in the API connection settings."> <div>
Hint: Download models and set the URL in the API connection settings. The model must be downloaded first! Do it with the <code>ollama pull</code> command or <a href="#" id="vectors_ollama_pull">click here</a>.
</div>
<i data-i18n="Hint: Set the URL in the API connection settings.">
Hint: Set the URL in the API connection settings.
</i> </i>
</div> </div>
<div class="flex-container flexFlowColumn" id="llamacpp_vectorsModel"> <div class="flex-container flexFlowColumn" id="llamacpp_vectorsModel">