forked from open-webui/open-webui
fix: ollama gguf upload
This commit is contained in:
parent
af4caec4f5
commit
bc80f1438c
3 changed files with 26 additions and 12 deletions
|
@ -196,7 +196,7 @@
|
|||
const file = modelInputFile ? modelInputFile[0] : null;
|
||||
|
||||
if (file) {
|
||||
fileResponse = uploadModel(localStorage.token, file, selectedOllamaUrlIdx).catch(
|
||||
fileResponse = await uploadModel(localStorage.token, file, selectedOllamaUrlIdx).catch(
|
||||
(error) => {
|
||||
toast.error(error);
|
||||
return null;
|
||||
|
@ -204,12 +204,14 @@
|
|||
);
|
||||
}
|
||||
} else {
|
||||
fileResponse = downloadModel(localStorage.token, modelFileUrl, selectedOllamaUrlIdx).catch(
|
||||
(error) => {
|
||||
toast.error(error);
|
||||
return null;
|
||||
}
|
||||
);
|
||||
fileResponse = await downloadModel(
|
||||
localStorage.token,
|
||||
modelFileUrl,
|
||||
selectedOllamaUrlIdx
|
||||
).catch((error) => {
|
||||
toast.error(error);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
if (fileResponse && fileResponse.ok) {
|
||||
|
@ -313,7 +315,10 @@
|
|||
}
|
||||
|
||||
modelFileUrl = '';
|
||||
modelUploadInputElement.value = '';
|
||||
|
||||
if (modelUploadInputElement) {
|
||||
modelUploadInputElement.value = '';
|
||||
}
|
||||
modelInputFile = null;
|
||||
modelTransferring = false;
|
||||
uploadProgress = null;
|
||||
|
@ -741,7 +746,7 @@
|
|||
|
||||
{#if (modelUploadMode === 'file' && modelInputFile && modelInputFile.length > 0) || (modelUploadMode === 'url' && modelFileUrl !== '')}
|
||||
<button
|
||||
class="px-3 text-gray-100 bg-emerald-600 hover:bg-emerald-700 disabled:bg-gray-700 disabled:cursor-not-allowed rounded transition"
|
||||
class="px-2.5 bg-gray-100 hover:bg-gray-200 text-gray-800 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-gray-100 rounded-lg disabled:bg-gray-700 disabled:cursor-not-allowed transition"
|
||||
type="submit"
|
||||
disabled={modelTransferring}
|
||||
>
|
||||
|
@ -796,7 +801,7 @@
|
|||
<div class=" my-2.5 text-sm font-medium">{$i18n.t('Modelfile Content')}</div>
|
||||
<textarea
|
||||
bind:value={modelFileContent}
|
||||
class="w-full rounded py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-800 outline-none resize-none"
|
||||
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-100 dark:text-gray-100 dark:bg-gray-850 outline-none resize-none"
|
||||
rows="6"
|
||||
/>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue