diff --git a/src/routes/(app)/modelfiles/+page.svelte b/src/routes/(app)/modelfiles/+page.svelte
index 41691524..d3c0b098 100644
--- a/src/routes/(app)/modelfiles/+page.svelte
+++ b/src/routes/(app)/modelfiles/+page.svelte
@@ -15,6 +15,7 @@
} from '$lib/apis/modelfiles';
let localModelfiles = [];
+ let importFiles;
const deleteModelHandler = async (tagName) => {
let success = null;
@@ -199,78 +200,133 @@
{/each}
- {#if localModelfiles.length > 0}
-
+
-
-
- {localModelfiles.length} Local Modelfiles Detected
-
+
+
+
{
+ console.log(importFiles);
-
-
+ reader.readAsText(importFiles[0]);
+ }}
+ />
-
+
+
- {/if}
+
+ {#if localModelfiles.length > 0}
+
+
+ {localModelfiles.length} Local Modelfiles Detected
+
+
+
+
{
+ for (const modelfile of localModelfiles) {
+ await createNewModelfile(localStorage.token, modelfile).catch((error) => {
+ return null;
+ });
+ }
+
+ saveModelfiles(localModelfiles);
+ localStorage.removeItem('modelfiles');
+ localModelfiles = JSON.parse(localStorage.getItem('modelfiles') ?? '[]');
+ await modelfiles.set(await getModelfiles(localStorage.token));
+ }}
+ >
+ Sync All
+
+
+
+
+
{
+ saveModelfiles(localModelfiles);
+
+ localStorage.removeItem('modelfiles');
+ localModelfiles = JSON.parse(localStorage.getItem('modelfiles') ?? '[]');
+ await modelfiles.set(await getModelfiles(localStorage.token));
+ }}
+ >
+
+
+
+
+ {/if}
+
Made by OllamaHub Community