{#if loaded} { deleteModelHandler(selectedModel); }} /> {$i18n.t('Models')} {filteredModels.length} {#each filteredModels as model} {model.name} {#if (model?.meta?.description ?? '').trim()} {model?.meta?.description} {:else} {model.id} {/if} {$i18n.t('By {{name}}', { name: capitalizeFirstLetter( model?.user?.name ?? model?.user?.email ?? $i18n.t('Deleted User') ) })} {#if shiftKey} { deleteModelHandler(model); }} > {:else} {#if $user?.role === 'admin' || model.user_id === $user?.id} {/if} { shareModelHandler(model); }} cloneHandler={() => { cloneModelHandler(model); }} exportHandler={() => { exportModelHandler(model); }} hideHandler={() => { hideModelHandler(model); }} deleteHandler={() => { selectedModel = model; showModelDeleteConfirm = true; }} onClose={() => {}} > { toggleModelById(localStorage.token, model.id); _models.set(await getModels(localStorage.token)); }} /> {/if} {/each} {#if $user?.role === 'admin'} { console.log(importFiles); let reader = new FileReader(); reader.onload = async (event) => { let savedModels = JSON.parse(event.target.result); console.log(savedModels); for (const model of savedModels) { if (model?.info ?? false) { if ($_models.find((m) => m.id === model.id)) { await updateModelById(localStorage.token, model.id, model.info).catch( (error) => { return null; } ); } else { await createNewModel(localStorage.token, model.info).catch((error) => { return null; }); } } } await _models.set(await getModels(localStorage.token)); models = await getWorkspaceModels(localStorage.token); }; reader.readAsText(importFiles[0]); }} /> { modelsImportInputElement.click(); }} > {$i18n.t('Import Models')} { downloadModels($_models); }} > {$i18n.t('Export Models')} {/if} {#if $config?.features.enable_community_sharing} {$i18n.t('Made by OpenWebUI Community')} {$i18n.t('Discover a model')} {$i18n.t('Discover, download, and explore model presets')} {/if} {:else} {/if}