Ver código fonte

removing sorting of models by name

cadenmackenzie 9 meses atrás
pai
commit
3eb726cee0
1 arquivos alterados com 2 adições e 7 exclusões
  1. 2 7
      exo/tinychat/index.js

+ 2 - 7
exo/tinychat/index.js

@@ -88,16 +88,11 @@ document.addEventListener("alpine:init", () => {
         const sel = document.querySelector('.model-select');
         sel.innerHTML = '';
 
-        // Convert the model pool to an array of [key, value] pairs and sort by name
-        const sortedModels = Object.entries(data["model pool"]).sort((a, b) => 
-          a[1].name.localeCompare(b[1].name)
-        );
-
-        sortedModels.forEach(([key, value]) => {
+        // Use the model pool entries in their original order
+        Object.entries(data["model pool"]).forEach(([key, value]) => {
           const opt = document.createElement("option");
           opt.value = key;
           opt.textContent = `${value.name}${value.downloaded ? ' (downloaded)' : ''}`;
-          opt.classList.add(value.downloaded ? 'model-downloaded' : 'model-not-downloaded');
           sel.appendChild(opt);
         });
       } catch (error) {