From 50a90c4538ddcf9c2ef21118640c1826691245b3 Mon Sep 17 00:00:00 2001
From: deep1401 <gandhi0869@gmail.com>
Date: Thu, 27 Feb 2025 08:14:17 -0800
Subject: [PATCH] Add local path as well when checking if a model exists
 locally

---
 .../components/Experiment/Train/LoRATrainingRunButton.tsx    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/renderer/components/Experiment/Train/LoRATrainingRunButton.tsx b/src/renderer/components/Experiment/Train/LoRATrainingRunButton.tsx
index e61cfee3..0c085aaf 100644
--- a/src/renderer/components/Experiment/Train/LoRATrainingRunButton.tsx
+++ b/src/renderer/components/Experiment/Train/LoRATrainingRunButton.tsx
@@ -50,7 +50,7 @@ export default function LoRATrainingRunButton({
         });
         let modelInLocalList = false;
         models_downloaded.forEach(modelData => {
-          if (modelData.model_id == model) {
+          if (modelData.model_id == model || modelData.local_path === model) {
             modelInLocalList = true;
           }
         });
@@ -85,7 +85,7 @@ export default function LoRATrainingRunButton({
             datasetInLocalList = true;
           }
         });
-        
+
         if(modelInLocalList && datasetInLocalList){
           // Use fetch API to call endpoint
           await fetch(
@@ -108,6 +108,7 @@ export default function LoRATrainingRunButton({
           if (!datasetInLocalList) {
             msg += "\n- Dataset: " + dataset;
           }
+
           if (!modelInLocalList) {
             msg += "\n- Model: " + model;
           }
-- 
GitLab