[object Object]

← back to Exo

reducing redundent checks

972074e98b2f39a0931664672364cbf01182423b · 2024-11-14 09:50:09 -0800 · cadenmackenzie

Files touched

Diff

commit 972074e98b2f39a0931664672364cbf01182423b
Author: cadenmackenzie <cadenmackenzie@gmail.com>
Date:   Thu Nov 14 09:50:09 2024 -0800

    reducing redundent checks
---
 exo/tinychat/index.js | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/exo/tinychat/index.js b/exo/tinychat/index.js
index b46f99e8..e64ce636 100644
--- a/exo/tinychat/index.js
+++ b/exo/tinychat/index.js
@@ -111,19 +111,17 @@ document.addEventListener("alpine:init", () => {
         Array.from(sel.options).forEach(opt => {
           const modelInfo = data["model pool"][opt.value];
           if (modelInfo) {
-            let displayText = modelInfo.name;
-            if (modelInfo.downloaded) {
-              if (modelInfo.download_percentage === 100) {
-                displayText += ' (downloaded)';
-              } else if (modelInfo.download_percentage != null) {
-                displayText += ` (${Math.round(modelInfo.download_percentage)}% downloaded)`;
+              let displayText = modelInfo.name;
+              if (modelInfo.download_percentage != null) {
+                  if (modelInfo.downloaded) {
+                      displayText += ' (downloaded)';
+                  } else {
+                      displayText += ` (${Math.round(modelInfo.download_percentage)}% downloaded)`;
+                  }
               }
-            } else if (modelInfo.download_percentage != null && modelInfo.download_percentage > 0) {
-              displayText += ` (${Math.round(modelInfo.download_percentage)}% downloaded)`;
-            }
-            opt.textContent = displayText;
+              opt.textContent = displayText;
           }
-        });
+      });
       } catch (error) {
         console.error("Error populating model selector:", error);
         this.setError(error);

← dfcf513d removing is_model_downloaded method and changing how downloa  ·  back to Exo  ·  removing checking of percentage for models that are not foun dd38924e →