feat: small change to support ollama pull QOL

Use regex replace during trim "sanitize" to support `ollama run ` or `ollama pull ` syntax.
This commit is contained in:
Self Denial 2024-04-13 03:04:11 -06:00
parent 51afb1e378
commit 922628c1ee

View file

@ -139,7 +139,7 @@
};
const pullModelHandler = async () => {
const sanitizedModelTag = modelTag.trim();
const sanitizedModelTag = modelTag.trim().replace(/^ollama\s+(run|pull)\s+/, '');
if (modelDownloadStatus[sanitizedModelTag]) {
toast.error(
$i18n.t(`Model '{{modelTag}}' is already in queue for downloading.`, {