From fef4f87bc598a1f9d6a2f05a9a13aa7baf84a346 Mon Sep 17 00:00:00 2001 From: Tony Salomone <dadmobile@gmail.com> Date: Thu, 9 May 2024 16:49:25 -0400 Subject: [PATCH] Pass source to model import. --- .../components/ModelZoo/ImportModelsModal.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/renderer/components/ModelZoo/ImportModelsModal.tsx b/src/renderer/components/ModelZoo/ImportModelsModal.tsx index 6dcb88d1..0f646f99 100644 --- a/src/renderer/components/ModelZoo/ImportModelsModal.tsx +++ b/src/renderer/components/ModelZoo/ImportModelsModal.tsx @@ -25,7 +25,7 @@ const fetcher = (url) => fetch(url).then((res) => res.json()); export default function ImportModelsModal({ open, setOpen}) { const [importing, setImporting] = useState(false); - const [modelFolder, setModelFolder] = useState(null); + const [modelFolder, setModelFolder] = useState(null); // Disabled folder support const { data: modelsData, @@ -52,14 +52,15 @@ export default function ImportModelsModal({ open, setOpen}) { let next = model_ids.next(); while(!next.done) { - // In the iterator, each iteam is a key (model_id) and a value (blank) + // In the iterator, each item is a key (model_id) and a value (model_source) // this is just how it gets produced from the form const model_id = next.value[0]; + const model_source = next.value[1]; console.log("Importing " + model_id); const response = await fetch( // TODO: Hardcoding hugging face as model source for now as it's the only source - chatAPI.Endpoints.Models.ImportLocal("huggingface", model_id) + chatAPI.Endpoints.Models.ImportLocal(model_source, model_id) ); // Read the response to see if it was successful and report any errors @@ -202,7 +203,11 @@ export default function ImportModelsModal({ open, setOpen}) { {row.installed ? " " : (row.supported - ? <Checkbox name={row.id} defaultChecked /> + ? <Checkbox + name={row.id} + value={row.source} + defaultChecked + /> : <Checkbox disabled /> ) } -- GitLab