From 4177682e6dfa27cf253eef762f48889d464940eb Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Mon, 18 Nov 2024 23:33:14 +0100 Subject: [PATCH] synced --- lollms_core | 2 +- lollms_webui.py | 10 +++++++++- .../assets/{index-CLdgSyWg.js => index-Jzkex9MN.js} | 2 +- web/dist/index.html | 2 +- web/dist/themes/borg.css | 2 +- web/src/main.js | 2 +- zoos/models_zoo | 2 +- 7 files changed, 15 insertions(+), 7 deletions(-) rename web/dist/assets/{index-CLdgSyWg.js => index-Jzkex9MN.js} (99%) diff --git a/lollms_core b/lollms_core index a2097be6..adf29235 160000 --- a/lollms_core +++ b/lollms_core @@ -1 +1 @@ -Subproject commit a2097be6cf79aa08bdf48e32535c7d27e1649dcc +Subproject commit adf292355d72a20c2ee4a4ab94c95f52f629686e diff --git a/lollms_webui.py b/lollms_webui.py index b27ffc2d..50be5541 100644 --- a/lollms_webui.py +++ b/lollms_webui.py @@ -1148,11 +1148,19 @@ class LOLLMSWebUI(LOLLMSElfServer): self.set_active_model(self.routing_model) models = [f"{k}" for k,v in self.config.smart_routing_models_description.items()] - output_id = self.personality.multichoice_question("Select most suitable model to answer the user request given the context:\n", [f"{k}: {v}" for k,v in self.config.smart_routing_models_description.items()], "user request:" + prompt) + output_id, explanation = self.personality.multichoice_question("Select most suitable model to answer the user request given the context:\n", [f"{k}: {v}" for k,v in self.config.smart_routing_models_description.items()], "user request:" + prompt, return_explanation=True) if output_id >=0 and output_id{this.$store.state.toast.showToast(`Personality couldn't be copied to the custom personalities folder: `,4,!1),console.error(e)})},async remountPersonality(n){await this.unmountPersonality(n),await this.mountPersonality(n)},onPersonalityReinstall(n){console.log("on reinstall ",n),this.isLoading=!0,console.log("Personality path:",n.personality.path),ne.post("/reinstall_personality",{client_id:this.$store.state.client_id,name:n.personality.path},{headers:this.posts_headers}).then(e=>{if(e)return this.isLoading=!1,console.log("reinstall_personality",e),e.data.status?this.$store.state.toast.showToast("Personality reinstalled successfully!",4,!0):this.$store.state.toast.showToast("Could not reinstall personality",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this.$store.state.toast.showToast(`Could not reinstall personality -`+e.message,4,!1),{status:!1}))},async handleOpenFolder(n){await ne.post("/open_personality_folder",{client_id:this.$store.state.client_id,personality_folder:n.personality.folder})},showMessage(n,e){this.message=n,this.successMessage=e,setTimeout(()=>{this.message=""},3e3)},loadPersonalities(){this.loading=!0,setTimeout(()=>{this.personalities=this.$store.state.personalities,this.loading=!1},500)}},mounted(){this.loadFavoritesFromLocalStorage(),this.loading=!0,setTimeout(()=>{this.personalities=this.$store.state.personalities,this.loading=!1},500)}},SAt={class:"app-zoo mb-100 pb-100 pt-12 background-color w-full p-6 overflow-y-auto h-screen scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},TAt={class:"panels-color shadow-lg rounded-lg p-4 max-w-4xl mx-auto mb-8"},xAt={class:"flex flex-wrap items-center justify-between gap-4"},CAt={key:0},wAt={key:1,class:"error"},RAt={class:"relative flex-grow max-w-md"},AAt={class:"flex items-center space-x-4"},MAt=["value"],NAt={class:"flex items-center space-x-4"},OAt={key:0,class:"flex justify-center items-center space-x-2 my-8","aria-live":"polite"},IAt={key:1},kAt={class:"container mx-auto px-4 flex flex-column pb-20"},DAt={key:0},LAt={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8 mb-12"},PAt={class:"container mx-auto px-4 flex flex-column pb-20"},FAt={class:"text-2xl font-bold my-8"},UAt={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8 mb-12"},BAt={key:2,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 overflow-y-auto"},GAt={class:"bg-white rounded-lg p-6 w-11/12 h-5/6 flex flex-col"},VAt={class:"flex justify-between items-center mb-4"},zAt={class:"text-2xl font-bold"},HAt=["srcdoc"],qAt={key:1,class:"text-center text-red-500"};function YAt(n,e,t,s,r,i){const o=Ze("personality-entry");return T(),x("div",SAt,[l("nav",TAt,[l("div",xAt,[r.message?(T(),x("p",CAt,Y(r.message),1)):B("",!0),r.error?(T(),x("p",wAt,Y(r.error),1)):B("",!0),l("div",RAt,[k(l("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>r.searchQuery=a),placeholder:"Search personalities...",class:"w-full border-b-2 border-gray-300 px-4 py-2 pl-10 focus:outline-none focus:border-blue-500 transition duration-300 ease-in-out","aria-label":"Search personalities"},null,512),[[ae,r.searchQuery]]),e[5]||(e[5]=l("svg",{class:"w-5 h-5 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1))]),l("div",AAt,[e[7]||(e[7]=l("label",{for:"category-select",class:"font-semibold"},"Category:",-1)),k(l("select",{id:"category-select","onUpdate:modelValue":e[1]||(e[1]=a=>r.selectedCategory=a),class:"border-2 border-gray-300 rounded-md px-2 py-1"},[e[6]||(e[6]=l("option",{value:"all"},"All Categories",-1)),(T(!0),x(Fe,null,We(i.categories,a=>(T(),x("option",{key:a,value:a},Y(a),9,MAt))),128))],512),[[Ot,r.selectedCategory]])]),l("div",NAt,[e[9]||(e[9]=l("label",{for:"sort-select",class:"font-semibold"},"Sort by:",-1)),k(l("select",{id:"sort-select","onUpdate:modelValue":e[2]||(e[2]=a=>r.sortBy=a),class:"border-2 border-gray-300 rounded-md px-2 py-1"},e[8]||(e[8]=[l("option",{value:"name"},"Name",-1),l("option",{value:"author"},"Author",-1),l("option",{value:"date"},"Creation Date",-1),l("option",{value:"update"},"Last Update",-1)]),512),[[Ot,r.sortBy]]),l("button",{onClick:e[3]||(e[3]=(...a)=>i.toggleSortOrder&&i.toggleSortOrder(...a)),class:"btn btn-secondary"},Y(r.sortOrder==="asc"?"↑":"↓"),1)])])]),r.loading?(T(),x("div",OAt,e[10]||(e[10]=[l("div",{class:"animate-spin rounded-full h-10 w-10 border-t-2 border-b-2 border-blue-500"},null,-1),l("span",{class:"text-xl text-gray-700 font-semibold"},"Loading...",-1)]))):(T(),x("div",IAt,[l("div",kAt,[i.favoriteApps.length>0&&!r.searchQuery?(T(),x("div",DAt,[e[11]||(e[11]=l("h2",{class:"text-2xl font-bold my-8"},"Favorite Apps",-1)),l("div",LAt,[(T(!0),x(Fe,null,We(i.favoriteApps,a=>(T(),at(o,{ref_for:!0,ref:"personalitiesZoo",key:a.uid,personality:a,select_language:!0,full_path:a.full_path,selected:i.configFile.active_personality_id==i.configFile.personalities.findIndex(c=>c===a.full_path||c===a.full_path+":"+a.language),"on-selected":i.onPersonalitySelected,"on-mount":i.mountPersonality,"on-un-mount":i.unmountPersonality,"on-remount":i.remountPersonality,"on-edit":i.editPersonality,"on-copy-to-custom":i.copyToCustom,"on-reinstall":i.onPersonalityReinstall,"on-settings":n.onSettingsPersonality,"on-copy-personality-name":n.onCopyPersonalityName,"on-copy-to_custom":n.onCopyToCustom,"on-open-folder":i.handleOpenFolder,"on-toggle-favorite":i.toggleFavorite},null,8,["personality","full_path","selected","on-selected","on-mount","on-un-mount","on-remount","on-edit","on-copy-to-custom","on-reinstall","on-settings","on-copy-personality-name","on-copy-to_custom","on-open-folder","on-toggle-favorite"]))),128))])])):B("",!0)]),l("div",PAt,[l("h2",FAt,Y(i.currentCategoryName)+" ("+Y(i.sortedAndFilteredPersonalities.length)+")",1),l("div",UAt,[(T(!0),x(Fe,null,We(i.sortedAndFilteredPersonalities,a=>(T(),at(o,{ref_for:!0,ref:"personalitiesZoo",key:a.uid,personality:a,select_language:!0,full_path:a.full_path,selected:i.configFile.active_personality_id==i.configFile.personalities.findIndex(c=>c===a.full_path||c===a.full_path+":"+a.language),"on-selected":i.onPersonalitySelected,"on-mount":i.mountPersonality,"on-un-mount":i.unmountPersonality,"on-remount":i.remountPersonality,"on-edit":i.editPersonality,"on-copy-to-custom":i.copyToCustom,"on-reinstall":i.onPersonalityReinstall,"on-settings":n.onSettingsPersonality,"on-copy-personality-name":n.onCopyPersonalityName,"on-copy-to_custom":n.onCopyToCustom,"on-open-folder":i.handleOpenFolder,"toggle-favorite":i.toggleFavorite},null,8,["personality","full_path","selected","on-selected","on-mount","on-un-mount","on-remount","on-edit","on-copy-to-custom","on-reinstall","on-settings","on-copy-personality-name","on-copy-to_custom","on-open-folder","toggle-favorite"]))),128))])])])),r.selectedApp?(T(),x("div",BAt,[l("div",GAt,[l("div",VAt,[l("h2",zAt,Y(r.selectedApp.name),1),l("button",{onClick:e[4]||(e[4]=(...a)=>n.backToZoo&&n.backToZoo(...a)),class:"bg-gray-300 hover:bg-gray-400 px-4 py-2 rounded-lg transition duration-300 ease-in-out"},"Close")]),r.appCode?(T(),x("iframe",{key:0,srcdoc:r.appCode,class:"flex-grow border-none"},null,8,HAt)):(T(),x("p",qAt,"Please install this app to view its code."))])])):B("",!0),r.message?(T(),x("div",{key:3,class:Le(["fixed bottom-4 right-4 px-6 py-3 rounded-lg shadow-md",{"bg-green-100 text-green-800":r.successMessage,"bg-red-100 text-red-800":!r.successMessage}])},Y(r.message),3)):B("",!0),e[12]||(e[12]=l("div",{class:"h-20"},null,-1))])}const $At=st(EAt,[["render",YAt],["__scopeId","data-v-f8c39e0b"]]),WAt=z3({history:v3("/"),routes:[{path:"/apps_view/",name:"AppsZoo",component:vAt},{path:"/personalities_view/",name:"PersonalitiesZoo",component:$At},{path:"/auto_sd_view/",name:"AutoSD",component:xRt},{path:"/comfyui_view/",name:"ComfyUI",component:yRt},{path:"/playground/",name:"playground",component:Ket},{path:"/extensions/",name:"extensions",component:stt},{path:"/help_view/",name:"help_view",component:Wtt},{path:"/settings/",name:"settings",component:dpt},{path:"/training/",name:"training",component:Tpt},{path:"/quantizing/",name:"quantizing",component:Mpt},{path:"/",name:"discussions",component:mbt},{path:"/interactive/",name:"interactive",component:Sxt},{path:"/nodes/",name:"nodes",component:_Rt}]}),yp=PD(MXe);function KAt(n){const e={};for(const t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e}const Ps=cL({state(){return{theme_vars:{lollms_title:"LoLLMS",falling_object:"L",activate_dropping_animation:!1,lollms_welcome_short_message:"Welcome to LoLLMS WebUI",lollms_welcome_message:"Embark on a journey through the realm of advanced AI with LoLLMS, your ultimate companion for intelligent conversations and multimodal interactions. Unleash the power of large language models and explore new frontiers in artificial intelligence."},personalities_ready:!1,is_rt_on:!1,language:"english",languages:[],currentTheme:"",personality_editor:null,showPersonalityEditor:!1,selectedPersonality:null,currentPersonConfig:{ai_name:"",ai_author:"",ai_category:"",ai_language:"",ai_description:"",ai_conditionning:"",ai_disclaimer:"",ai_icon:null},posts_headers:{accept:"application/json","Content-Type":"application/json"},client_id:"",leftPanelCollapsed:!1,rightPanelCollapsed:!0,view_mode:localStorage.getItem("lollms_webui_view_mode")||"compact",yesNoDialog:null,universalForm:null,toast:null,news:null,messageBox:null,api_get_req:null,api_post_req:null,startSpeechRecognition:null,ready:!1,loading_infos:"",loading_progress:0,version:"unknown",settingsChanged:!1,isConnected:!1,isModelOk:!1,isGenerating:!1,config:null,mountedPers:null,mountedPersArr:[],bindingsZoo:[],modelsArr:[],selectedModel:null,personalities:[],diskUsage:null,ramUsage:null,vramUsage:null,modelsZoo:[],installedModels:[],installedBindings:[],currentModel:null,currentBinding:null,databases:[]}},mutations:{updatePersonality(n,e){const t=n.personalities.findIndex(s=>s.full_path===e.full_path);t!==-1?n.personalities[t]=e:console.log("Can't uipdate personality beceause it was Not found:",e.full_path)},setThemeVars(n,e){n.theme_vars=e},setLeftPanelCollapsed(n,e){n.leftPanelCollapsed=e,console.log(`Saving the status of left panel to ${e}`),localStorage.setItem("lollms_webui_left_panel_collapsed",e)},setRightPanelCollapsed(n,e){n.rightPanelCollapsed=e,console.log(`Saving the status of right panel to ${e}`),localStorage.setItem("lollms_webui_right_panel_collapsed",e)},setViewMode(n,e){n.view_mode=e,localStorage.setItem("lollms_webui_view_mode",e)},setpersonalitiesReady(n,e){n.personalities_ready=e},setisRTOn(n,e){n.is_rt_on=e},setLanguages(n,e){n.languages=e},setLanguage(n,e){n.language=e},setIsReady(n,e){n.ready=e},setIsConnected(n,e){n.isConnected=e},setIsModelOk(n,e){n.isModelOk=e},setIsGenerating(n,e){n.isGenerating=e},setConfig(n,e){n.config=e},setPersonalities(n,e){n.personalities=e},setMountedPers(n,e){n.mountedPers=e},setMountedPersArr(n,e){n.mountedPersArr=e},setbindingsZoo(n,e){n.bindingsZoo=e},setModelsArr(n,e){n.modelsArr=e},setselectedModel(n,e){n.selectedModel=e},setDiskUsage(n,e){n.diskUsage=e},setRamUsage(n,e){n.ramUsage=e},setVramUsage(n,e){n.vramUsage=e},setModelsZoo(n,e){n.modelsZoo=e},setCurrentBinding(n,e){n.currentBinding=e},setCurrentModel(n,e){n.currentModel=e},setDatabases(n,e){n.databases=e},setTheme(n){this.currentTheme=n}},getters:{getThemeVars(n){return n.theme_vars},getLeftPanelCollapsed(n){return n.leftPanelCollapsed},getRightPanelCollapsed(n){return n.rightPanelCollapsed},getViewMode(n){return n.view_mode},getpersonalitiesReady(n){return n.personalities_ready},getisRTOn(n){return n.is_rt_on},getLanguages(n){return n.languages},getLanguage(n){return n.language},getIsConnected(n){return n.isConnected},getIsModelOk(n){return n.isModelOk},getIsGenerating(n){return n.isGenerating},getConfig(n){return n.config},getPersonalities(n){return n.personalities},getMountedPersArr(n){return n.mountedPersArr},getMountedPers(n){return n.mountedPers},getbindingsZoo(n){return n.bindingsZoo},getModelsArr(n){return n.modelsArr},getDiskUsage(n){return n.diskUsage},getRamUsage(n){return n.ramUsage},getVramUsage(n){return n.vramUsage},getDatabasesList(n){return n.databases},getModelsZoo(n){return n.modelsZoo},getCyrrentBinding(n){return n.currentBinding},getCurrentModel(n){return n.currentModel}},actions:{async getVersion(){try{let n=await ne.get("/get_lollms_webui_version",{});n&&(this.state.version=n.data)}catch{console.error("Coudln't get version")}},async refreshConfig({commit:n}){console.log("Fetching configuration");try{console.log("Fetching configuration with client id: ",this.state.client_id);const e=await GO("get_config",this.state.client_id);e.active_personality_id<0&&(e.active_personality_id=0);let t=e.personalities[e.active_personality_id].split("/");e.personality_category=t[0],e.personality_folder=t[1],console.log("Recovered config"),console.log(e),console.log("Committing config"),console.log(e),console.log(this.state.config),n("setConfig",e)}catch(e){console.log(e.message,"refreshConfig")}},async refreshDatabase({commit:n}){let e=await Ks("list_databases");console.log("databases:",e),n("setDatabases",e)},async fetchisRTOn({commit:n}){const t=(await ne.get("/is_rt_on")).data.status;n("setisRTOn",t)},async fetchLanguages({commit:n}){console.log("get_personality_languages_list",this.state.client_id);const e=await ne.post("/get_personality_languages_list",{client_id:this.state.client_id});console.log("response",e);const t=e.data;console.log("languages",t),n("setLanguages",t)},async fetchLanguage({commit:n}){console.log("get_personality_language",this.state.client_id);const e=await ne.post("/get_personality_language",{client_id:this.state.client_id});console.log("response",e);const t=e.data;console.log("language",t),n("setLanguage",t)},async changeLanguage({commit:n},e){console.log("Changing language to ",e);let t=await ne.post("/set_personality_language",{client_id:this.state.client_id,language:e});console.log("get_personality_languages_list",this.state.client_id),t=await ne.post("/get_personality_languages_list",{client_id:this.state.client_id}),console.log("response",t);const s=t.data;console.log("languages",s),n("setLanguages",s),t=await ne.post("/get_personality_language",{client_id:this.state.client_id}),console.log("response",t);const r=t.data;console.log("language",r),n("setLanguage",r),await this.dispatch("refreshMountedPersonalities"),console.log("Language changed successfully:",r)},async deleteLanguage({commit:n},e){console.log("Deleting ",e);let t=await ne.post("/del_personality_language",{client_id:this.state.client_id,language:e});console.log("get_personality_languages_list",this.state.client_id),t=await ne.post("/get_personality_languages_list",{client_id:this.state.client_id});const s=t.data;n("setLanguages",s),t=await ne.post("/get_personality_language",{client_id:this.state.client_id});const r=t.data;n("setLanguage",r)},async refreshPersonalitiesZoo({commit:n}){let e=[];const t=await Ks("get_all_personalities"),s=Object.keys(t);for(let r=0;r{let d=!1;for(const _ of this.state.config.personalities)_.includes(i+"/"+c.folder)&&(d=!0);let u={};return u=c,u.category=i,u.full_path=i+"/"+c.folder,u.isMounted=d,u});e.length==0?e=a:e=e.concat(a)}e.sort((r,i)=>r.name.localeCompare(i.name)),n("setPersonalities",e),console.log("Done loading personalities")},refreshMountedPersonalities({commit:n}){this.state.config.active_personality_id<0&&(this.state.config.active_personality_id=0);let e=[];const t=[];for(let r=0;ra.full_path==i);if(o>=0){let a=KAt(this.state.personalities[o]);a?e.push(a):e.push(this.state.personalities[this.state.personalities.findIndex(c=>c.full_path=="generic/lollms")])}else t.push(r),console.log("Couldn't load personality : ",i)}for(let r=t.length-1;r>=0;r--)this.state.config.personalities.splice(t[r],1),this.state.config.active_personality_id>t[r]&&(this.state.config.active_personality_id-=1);n("setMountedPersArr",e);const s=this.state.personalities[this.state.personalities.findIndex(r=>r.full_path==this.state.config.personalities[this.state.config.active_personality_id])];console.log("Setting current mounted personality: ",s),this.state.mountedPers=s},async refreshBindings({commit:n}){let e=await Ks("list_bindings");console.log("Loaded bindings zoo :",e),this.state.installedBindings=e.filter(s=>s.installed),console.log("Loaded bindings zoo ",this.state.installedBindings),n("setbindingsZoo",e);const t=e.findIndex(s=>s.name==this.state.config.binding_name);t!=-1&&n("setCurrentBinding",e[t])},async refreshModelsZoo({commit:n}){const t=(await ne.get("/get_available_models")).data.filter(s=>s.variants&&s.variants.length>0);n("setModelsZoo",t)},async refreshModelStatus({commit:n}){let e=await Ks("get_model_status");n("setIsModelOk",e.status)},async refreshModels({commit:n}){let e=await Ks("list_models"),t=await Ks("get_active_model");t!=null&&n("setselectedModel",t.model),n("setModelsArr",e),this.state.modelsZoo.map(r=>{r.isInstalled=e.includes(r.name)}),this.state.installedModels=this.state.modelsZoo.filter(r=>r.isInstalled);const s=this.state.modelsZoo.findIndex(r=>r.name==this.state.config.model_name);s!=-1&&n("setCurrentModel",this.state.modelsZoo[s])},async refreshDiskUsage({commit:n}){this.state.diskUsage=await Ks("disk_usage")},async refreshRamUsage({commit:n}){this.state.ramUsage=await Ks("ram_usage")},async refreshVramUsage({commit:n}){const e=await Ks("vram_usage"),t=[];if(e.nb_gpus>0){for(let r=0;r{this.message=""},3e3)},loadPersonalities(){this.loading=!0,setTimeout(()=>{this.personalities=this.$store.state.personalities,this.loading=!1},500)}},mounted(){this.loadFavoritesFromLocalStorage(),this.loading=!0,setTimeout(()=>{this.personalities=this.$store.state.personalities,this.loading=!1},500)}},SAt={class:"app-zoo mb-100 pb-100 pt-12 background-color w-full p-6 overflow-y-auto h-screen scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},TAt={class:"panels-color shadow-lg rounded-lg p-4 max-w-4xl mx-auto mb-8"},xAt={class:"flex flex-wrap items-center justify-between gap-4"},CAt={key:0},wAt={key:1,class:"error"},RAt={class:"relative flex-grow max-w-md"},AAt={class:"flex items-center space-x-4"},MAt=["value"],NAt={class:"flex items-center space-x-4"},OAt={key:0,class:"flex justify-center items-center space-x-2 my-8","aria-live":"polite"},IAt={key:1},kAt={class:"container mx-auto px-4 flex flex-column pb-20"},DAt={key:0},LAt={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8 mb-12"},PAt={class:"container mx-auto px-4 flex flex-column pb-20"},FAt={class:"text-2xl font-bold my-8"},UAt={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8 mb-12"},BAt={key:2,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 overflow-y-auto"},GAt={class:"bg-white rounded-lg p-6 w-11/12 h-5/6 flex flex-col"},VAt={class:"flex justify-between items-center mb-4"},zAt={class:"text-2xl font-bold"},HAt=["srcdoc"],qAt={key:1,class:"text-center text-red-500"};function YAt(n,e,t,s,r,i){const o=Ze("personality-entry");return T(),x("div",SAt,[l("nav",TAt,[l("div",xAt,[r.message?(T(),x("p",CAt,Y(r.message),1)):B("",!0),r.error?(T(),x("p",wAt,Y(r.error),1)):B("",!0),l("div",RAt,[k(l("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>r.searchQuery=a),placeholder:"Search personalities...",class:"w-full border-b-2 border-gray-300 px-4 py-2 pl-10 focus:outline-none focus:border-blue-500 transition duration-300 ease-in-out","aria-label":"Search personalities"},null,512),[[ae,r.searchQuery]]),e[5]||(e[5]=l("svg",{class:"w-5 h-5 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1))]),l("div",AAt,[e[7]||(e[7]=l("label",{for:"category-select",class:"font-semibold"},"Category:",-1)),k(l("select",{id:"category-select","onUpdate:modelValue":e[1]||(e[1]=a=>r.selectedCategory=a),class:"border-2 border-gray-300 rounded-md px-2 py-1"},[e[6]||(e[6]=l("option",{value:"all"},"All Categories",-1)),(T(!0),x(Fe,null,We(i.categories,a=>(T(),x("option",{key:a,value:a},Y(a),9,MAt))),128))],512),[[Ot,r.selectedCategory]])]),l("div",NAt,[e[9]||(e[9]=l("label",{for:"sort-select",class:"font-semibold"},"Sort by:",-1)),k(l("select",{id:"sort-select","onUpdate:modelValue":e[2]||(e[2]=a=>r.sortBy=a),class:"border-2 border-gray-300 rounded-md px-2 py-1"},e[8]||(e[8]=[l("option",{value:"name"},"Name",-1),l("option",{value:"author"},"Author",-1),l("option",{value:"date"},"Creation Date",-1),l("option",{value:"update"},"Last Update",-1)]),512),[[Ot,r.sortBy]]),l("button",{onClick:e[3]||(e[3]=(...a)=>i.toggleSortOrder&&i.toggleSortOrder(...a)),class:"btn btn-secondary"},Y(r.sortOrder==="asc"?"↑":"↓"),1)])])]),r.loading?(T(),x("div",OAt,e[10]||(e[10]=[l("div",{class:"animate-spin rounded-full h-10 w-10 border-t-2 border-b-2 border-blue-500"},null,-1),l("span",{class:"text-xl text-gray-700 font-semibold"},"Loading...",-1)]))):(T(),x("div",IAt,[l("div",kAt,[i.favoriteApps.length>0&&!r.searchQuery?(T(),x("div",DAt,[e[11]||(e[11]=l("h2",{class:"text-2xl font-bold my-8"},"Favorite Apps",-1)),l("div",LAt,[(T(!0),x(Fe,null,We(i.favoriteApps,a=>(T(),at(o,{ref_for:!0,ref:"personalitiesZoo",key:a.uid,personality:a,select_language:!0,full_path:a.full_path,selected:i.configFile.active_personality_id==i.configFile.personalities.findIndex(c=>c===a.full_path||c===a.full_path+":"+a.language),"on-selected":i.onPersonalitySelected,"on-mount":i.mountPersonality,"on-un-mount":i.unmountPersonality,"on-remount":i.remountPersonality,"on-edit":i.editPersonality,"on-copy-to-custom":i.copyToCustom,"on-reinstall":i.onPersonalityReinstall,"on-settings":n.onSettingsPersonality,"on-copy-personality-name":n.onCopyPersonalityName,"on-copy-to_custom":n.onCopyToCustom,"on-open-folder":i.handleOpenFolder,"on-toggle-favorite":i.toggleFavorite},null,8,["personality","full_path","selected","on-selected","on-mount","on-un-mount","on-remount","on-edit","on-copy-to-custom","on-reinstall","on-settings","on-copy-personality-name","on-copy-to_custom","on-open-folder","on-toggle-favorite"]))),128))])])):B("",!0)]),l("div",PAt,[l("h2",FAt,Y(i.currentCategoryName)+" ("+Y(i.sortedAndFilteredPersonalities.length)+")",1),l("div",UAt,[(T(!0),x(Fe,null,We(i.sortedAndFilteredPersonalities,a=>(T(),at(o,{ref_for:!0,ref:"personalitiesZoo",key:a.uid,personality:a,select_language:!0,full_path:a.full_path,selected:i.configFile.active_personality_id==i.configFile.personalities.findIndex(c=>c===a.full_path||c===a.full_path+":"+a.language),"on-selected":i.onPersonalitySelected,"on-mount":i.mountPersonality,"on-un-mount":i.unmountPersonality,"on-remount":i.remountPersonality,"on-edit":i.editPersonality,"on-copy-to-custom":i.copyToCustom,"on-reinstall":i.onPersonalityReinstall,"on-settings":n.onSettingsPersonality,"on-copy-personality-name":n.onCopyPersonalityName,"on-copy-to_custom":n.onCopyToCustom,"on-open-folder":i.handleOpenFolder,"toggle-favorite":i.toggleFavorite},null,8,["personality","full_path","selected","on-selected","on-mount","on-un-mount","on-remount","on-edit","on-copy-to-custom","on-reinstall","on-settings","on-copy-personality-name","on-copy-to_custom","on-open-folder","toggle-favorite"]))),128))])])])),r.selectedApp?(T(),x("div",BAt,[l("div",GAt,[l("div",VAt,[l("h2",zAt,Y(r.selectedApp.name),1),l("button",{onClick:e[4]||(e[4]=(...a)=>n.backToZoo&&n.backToZoo(...a)),class:"bg-gray-300 hover:bg-gray-400 px-4 py-2 rounded-lg transition duration-300 ease-in-out"},"Close")]),r.appCode?(T(),x("iframe",{key:0,srcdoc:r.appCode,class:"flex-grow border-none"},null,8,HAt)):(T(),x("p",qAt,"Please install this app to view its code."))])])):B("",!0),r.message?(T(),x("div",{key:3,class:Le(["fixed bottom-4 right-4 px-6 py-3 rounded-lg shadow-md",{"bg-green-100 text-green-800":r.successMessage,"bg-red-100 text-red-800":!r.successMessage}])},Y(r.message),3)):B("",!0),e[12]||(e[12]=l("div",{class:"h-20"},null,-1))])}const $At=st(EAt,[["render",YAt],["__scopeId","data-v-f8c39e0b"]]),WAt=z3({history:v3("/"),routes:[{path:"/apps_view/",name:"AppsZoo",component:vAt},{path:"/personalities_view/",name:"PersonalitiesZoo",component:$At},{path:"/auto_sd_view/",name:"AutoSD",component:xRt},{path:"/comfyui_view/",name:"ComfyUI",component:yRt},{path:"/playground/",name:"playground",component:Ket},{path:"/extensions/",name:"extensions",component:stt},{path:"/help_view/",name:"help_view",component:Wtt},{path:"/settings/",name:"settings",component:dpt},{path:"/training/",name:"training",component:Tpt},{path:"/quantizing/",name:"quantizing",component:Mpt},{path:"/",name:"discussions",component:mbt},{path:"/interactive/",name:"interactive",component:Sxt},{path:"/nodes/",name:"nodes",component:_Rt}]}),yp=PD(MXe);function KAt(n){const e={};for(const t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e}const Ps=cL({state(){return{theme_vars:{lollms_title:"LoLLMS",falling_object:"L",activate_dropping_animation:!1,lollms_welcome_short_message:"Welcome to LoLLMS WebUI",lollms_welcome_message:"Embark on a journey through the realm of advanced AI with LoLLMS, your ultimate companion for intelligent conversations and multimodal interactions. Unleash the power of large language models and explore new frontiers in artificial intelligence."},personalities_ready:!1,is_rt_on:!1,language:"english",languages:[],currentTheme:"",personality_editor:null,showPersonalityEditor:!1,selectedPersonality:null,currentPersonConfig:{ai_name:"",ai_author:"",ai_category:"",ai_language:"",ai_description:"",ai_conditionning:"",ai_disclaimer:"",ai_icon:null},posts_headers:{accept:"application/json","Content-Type":"application/json"},client_id:"",leftPanelCollapsed:!1,rightPanelCollapsed:!0,view_mode:localStorage.getItem("lollms_webui_view_mode")||"compact",yesNoDialog:null,universalForm:null,toast:null,news:null,messageBox:null,api_get_req:null,api_post_req:null,startSpeechRecognition:null,ready:!1,loading_infos:"",loading_progress:0,version:"unknown",settingsChanged:!1,isConnected:!1,isModelOk:!1,isGenerating:!1,config:null,mountedPers:null,mountedPersArr:[],bindingsZoo:[],modelsArr:[],selectedModel:null,personalities:[],diskUsage:null,ramUsage:null,vramUsage:null,modelsZoo:[],installedModels:[],installedBindings:[],currentModel:null,currentBinding:null,databases:[]}},mutations:{updatePersonality(n,e){const t=n.personalities.findIndex(s=>s.full_path===e.full_path);t!==-1?n.personalities[t]=e:console.log("Can't uipdate personality beceause it was Not found:",e.full_path)},setThemeVars(n,e){n.theme_vars=e},setLeftPanelCollapsed(n,e){n.leftPanelCollapsed=e,console.log(`Saving the status of left panel to ${e}`),localStorage.setItem("lollms_webui_left_panel_collapsed",e)},setRightPanelCollapsed(n,e){n.rightPanelCollapsed=e,console.log(`Saving the status of right panel to ${e}`),localStorage.setItem("lollms_webui_right_panel_collapsed",e)},setViewMode(n,e){n.view_mode=e,localStorage.setItem("lollms_webui_view_mode",e)},setpersonalitiesReady(n,e){n.personalities_ready=e},setisRTOn(n,e){n.is_rt_on=e},setLanguages(n,e){n.languages=e},setLanguage(n,e){n.language=e},setIsReady(n,e){n.ready=e},setIsConnected(n,e){n.isConnected=e},setIsModelOk(n,e){n.isModelOk=e},setIsGenerating(n,e){n.isGenerating=e},setConfig(n,e){n.config=e},setPersonalities(n,e){n.personalities=e},setMountedPers(n,e){n.mountedPers=e},setMountedPersArr(n,e){n.mountedPersArr=e},setbindingsZoo(n,e){n.bindingsZoo=e},setModelsArr(n,e){n.modelsArr=e},setselectedModel(n,e){n.selectedModel=e},setDiskUsage(n,e){n.diskUsage=e},setRamUsage(n,e){n.ramUsage=e},setVramUsage(n,e){n.vramUsage=e},setModelsZoo(n,e){n.modelsZoo=e},setCurrentBinding(n,e){n.currentBinding=e},setCurrentModel(n,e){n.currentModel=e},setDatabases(n,e){n.databases=e},setTheme(n){this.currentTheme=n}},getters:{getThemeVars(n){return n.theme_vars},getLeftPanelCollapsed(n){return n.leftPanelCollapsed},getRightPanelCollapsed(n){return n.rightPanelCollapsed},getViewMode(n){return n.view_mode},getpersonalitiesReady(n){return n.personalities_ready},getisRTOn(n){return n.is_rt_on},getLanguages(n){return n.languages},getLanguage(n){return n.language},getIsConnected(n){return n.isConnected},getIsModelOk(n){return n.isModelOk},getIsGenerating(n){return n.isGenerating},getConfig(n){return n.config},getPersonalities(n){return n.personalities},getMountedPersArr(n){return n.mountedPersArr},getMountedPers(n){return n.mountedPers},getbindingsZoo(n){return n.bindingsZoo},getModelsArr(n){return n.modelsArr},getDiskUsage(n){return n.diskUsage},getRamUsage(n){return n.ramUsage},getVramUsage(n){return n.vramUsage},getDatabasesList(n){return n.databases},getModelsZoo(n){return n.modelsZoo},getCyrrentBinding(n){return n.currentBinding},getCurrentModel(n){return n.currentModel}},actions:{async getVersion(){try{let n=await ne.get("/get_lollms_webui_version",{});n&&(this.state.version=n.data)}catch{console.error("Coudln't get version")}},async refreshConfig({commit:n}){console.log("Fetching configuration");try{console.log("Fetching configuration with client id: ",this.state.client_id);const e=await GO("get_config",this.state.client_id);e.active_personality_id<0&&(e.active_personality_id=0);let t=e.personalities[e.active_personality_id].split("/");e.personality_category=t[0],e.personality_folder=t[1],console.log("Recovered config"),console.log(e),console.log("Committing config"),console.log(e),console.log(this.state.config),n("setConfig",e)}catch(e){console.log(e.message,"refreshConfig")}},async refreshDatabase({commit:n}){let e=await Ks("list_databases");console.log("databases:",e),n("setDatabases",e)},async fetchisRTOn({commit:n}){const t=(await ne.get("/is_rt_on")).data.status;n("setisRTOn",t)},async fetchLanguages({commit:n}){console.log("get_personality_languages_list",this.state.client_id);const e=await ne.post("/get_personality_languages_list",{client_id:this.state.client_id});console.log("response",e);const t=e.data;console.log("languages",t),n("setLanguages",t)},async fetchLanguage({commit:n}){console.log("get_personality_language",this.state.client_id);const e=await ne.post("/get_personality_language",{client_id:this.state.client_id});console.log("response",e);const t=e.data;console.log("language",t),n("setLanguage",t)},async changeLanguage({commit:n},e){console.log("Changing language to ",e);let t=await ne.post("/set_personality_language",{client_id:this.state.client_id,language:e});console.log("get_personality_languages_list",this.state.client_id),t=await ne.post("/get_personality_languages_list",{client_id:this.state.client_id}),console.log("response",t);const s=t.data;console.log("languages",s),n("setLanguages",s),t=await ne.post("/get_personality_language",{client_id:this.state.client_id}),console.log("response",t);const r=t.data;console.log("language",r),n("setLanguage",r),await this.dispatch("refreshMountedPersonalities"),console.log("Language changed successfully:",r)},async deleteLanguage({commit:n},e){console.log("Deleting ",e);let t=await ne.post("/del_personality_language",{client_id:this.state.client_id,language:e});console.log("get_personality_languages_list",this.state.client_id),t=await ne.post("/get_personality_languages_list",{client_id:this.state.client_id});const s=t.data;n("setLanguages",s),t=await ne.post("/get_personality_language",{client_id:this.state.client_id});const r=t.data;n("setLanguage",r)},async refreshPersonalitiesZoo({commit:n}){let e=[];const t=await Ks("get_all_personalities"),s=Object.keys(t);for(let r=0;r{let d=!1;for(const _ of this.state.config.personalities)_.includes(i+"/"+c.folder)&&(d=!0);let u={};return u=c,u.category=i,u.full_path=i+"/"+c.folder,u.isMounted=d,u});e.length==0?e=a:e=e.concat(a)}e.sort((r,i)=>r.name.localeCompare(i.name)),n("setPersonalities",e),console.log("Done loading personalities")},refreshMountedPersonalities({commit:n}){this.state.config.active_personality_id<0&&(this.state.config.active_personality_id=0);let e=[];const t=[];for(let r=0;ra.full_path==i);if(o>=0){let a=KAt(this.state.personalities[o]);a?e.push(a):e.push(this.state.personalities[this.state.personalities.findIndex(c=>c.full_path=="generic/lollms")])}else t.push(r),console.log("Couldn't load personality : ",i)}for(let r=t.length-1;r>=0;r--)this.state.config.personalities.splice(t[r],1),this.state.config.active_personality_id>t[r]&&(this.state.config.active_personality_id-=1);n("setMountedPersArr",e);const s=this.state.personalities[this.state.personalities.findIndex(r=>r.full_path==this.state.config.personalities[this.state.config.active_personality_id])];console.log("Setting current mounted personality: ",s),this.state.mountedPers=s},async refreshBindings({commit:n}){let e=await Ks("list_bindings");console.log("Loaded bindings zoo :",e),this.state.installedBindings=e.filter(s=>s.installed),console.log("Loaded bindings zoo ",this.state.installedBindings),n("setbindingsZoo",e);const t=e.findIndex(s=>s.name==this.state.config.binding_name);t!=-1&&n("setCurrentBinding",e[t])},async refreshModelsZoo({commit:n}){const t=(await ne.get("/get_available_models")).data;n("setModelsZoo",t)},async refreshModelStatus({commit:n}){let e=await Ks("get_model_status");n("setIsModelOk",e.status)},async refreshModels({commit:n}){let e=await Ks("list_models"),t=await Ks("get_active_model");t!=null&&n("setselectedModel",t.model),n("setModelsArr",e),this.state.modelsZoo.map(r=>{r.isInstalled=e.includes(r.name)}),this.state.installedModels=this.state.modelsZoo.filter(r=>r.isInstalled);const s=this.state.modelsZoo.findIndex(r=>r.name==this.state.config.model_name);s!=-1&&n("setCurrentModel",this.state.modelsZoo[s])},async refreshDiskUsage({commit:n}){this.state.diskUsage=await Ks("disk_usage")},async refreshRamUsage({commit:n}){this.state.ramUsage=await Ks("ram_usage")},async refreshVramUsage({commit:n}){const e=await Ks("vram_usage"),t=[];if(e.nb_gpus>0){for(let r=0;r LoLLMS WebUI - + diff --git a/web/dist/themes/borg.css b/web/dist/themes/borg.css index 38832a36..246c431b 100644 --- a/web/dist/themes/borg.css +++ b/web/dist/themes/borg.css @@ -4189,7 +4189,7 @@ button:hover{ border-top-left-radius: 0.375rem; border-bottom-left-radius: 0.375rem; --tw-bg-opacity: 1; - background-color: rgb(255 255 255 / var(--tw-bg-opacity)); + background-color: rgb(4 108 78 / var(--tw-bg-opacity)); padding: 0.5rem; --tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color); diff --git a/web/src/main.js b/web/src/main.js index 8b767e71..932a3ea4 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -491,7 +491,7 @@ export const store = createStore({ }, async refreshModelsZoo({ commit }) { const response = await axios.get('/get_available_models'); - const models_zoo = response.data.filter(model => model.variants && model.variants.length>0) + const models_zoo = response.data;//.filter(model => model.variants && model.variants.length>0) commit('setModelsZoo', models_zoo) }, async refreshModelStatus({ commit }) { diff --git a/zoos/models_zoo b/zoos/models_zoo index 5ee61221..eb08808f 160000 --- a/zoos/models_zoo +++ b/zoos/models_zoo @@ -1 +1 @@ -Subproject commit 5ee61221a32fb5dc4466838fe35cd83ea9a2403f +Subproject commit eb08808f59120c9bedeaedef732f929be19f2aef