diff --git a/web/dist/assets/index-23e002d5.js b/web/dist/assets/index-1f476e54.js similarity index 99% rename from web/dist/assets/index-23e002d5.js rename to web/dist/assets/index-1f476e54.js index 6c20564b..d5ce9734 100644 --- a/web/dist/assets/index-23e002d5.js +++ b/web/dist/assets/index-1f476e54.js @@ -176,7 +176,7 @@ If you are using windows, this uses wsl which requires you to have it installed If You are using windows, this will install wsl so you need to activate it. Here is how you can do that`))},iut)])]),u("tr",null,[sut,u("td",null,[u("div",rut,[u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[164]||(e[164]=(...h)=>r.reinstallvLLMService&&r.reinstallvLLMService(...h))},"install vLLM service"),u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[165]||(e[165]=(...h)=>r.startvLLMService&&r.startvLLMService(...h))},"start vllm service")])])]),u("tr",null,[out,u("td",null,[u("div",aut,[le(u("input",{type:"text",id:"vllm_url",required:"","onUpdate:modelValue":e[166]||(e[166]=h=>r.configFile.vllm_url=h),onChange:e[167]||(e[167]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.vllm_url]])])])]),u("tr",null,[lut,u("td",null,[u("div",cut,[u("div",dut,[uut,u("p",put,[le(u("input",{type:"text",id:"temp-val","onUpdate:modelValue":e[168]||(e[168]=h=>r.configFile.vllm_gpu_memory_utilization=h),onChange:e[169]||(e[169]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.vllm_gpu_memory_utilization]])])]),le(u("input",{id:"vllm_gpu_memory_utilization",onChange:e[170]||(e[170]=h=>s.settingsChanged=!0),type:"range","onUpdate:modelValue":e[171]||(e[171]=h=>r.configFile.vllm_gpu_memory_utilization=h),min:"0.10",max:"1",step:"0.01",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.vllm_gpu_memory_utilization]])])])]),u("tr",null,[_ut,u("td",null,[u("div",hut,[le(u("input",{type:"number",id:"vllm_max_num_seqs",min:"64",max:"2048",required:"","onUpdate:modelValue":e[172]||(e[172]=h=>r.configFile.vllm_max_num_seqs=h),onChange:e[173]||(e[173]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.vllm_max_num_seqs]])])])]),u("tr",null,[fut,u("td",null,[u("div",mut,[le(u("input",{type:"number",id:"vllm_max_model_len",min:"2048",max:"1000000",required:"","onUpdate:modelValue":e[174]||(e[174]=h=>r.configFile.vllm_max_model_len=h),onChange:e[175]||(e[175]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.vllm_max_model_len]])])])]),u("tr",null,[gut,u("td",null,[u("div",but,[le(u("input",{type:"text",id:"vllm_model_path",required:"","onUpdate:modelValue":e[176]||(e[176]=h=>r.configFile.vllm_model_path=h),onChange:e[177]||(e[177]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.vllm_model_path]])])])])])]),_:1}),Ie(o,{title:"Petals service",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",Eut,[u("tr",null,[vut,u("td",null,[u("div",yut,[le(u("input",{type:"checkbox",id:"enable_petals_service",required:"","onUpdate:modelValue":e[178]||(e[178]=h=>r.configFile.enable_petals_service=h),onChange:e[179]||(e[179]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ht,r.configFile.enable_petals_service]])])]),u("td",null,[u("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[180]||(e[180]=h=>this.$store.state.messageBox.showMessage(`Activates Petals service. The service will be automatically loaded at startup alowing you to use the petals endpoint to generate text in a distributed network. If You are using windows, this will install wsl so you need to activate it. -Here is how you can do that`))},Tut)])]),u("tr",null,[xut,u("td",null,[u("div",Cut,[u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[181]||(e[181]=(...h)=>r.reinstallPetalsService&&r.reinstallPetalsService(...h))},"install petals service")])])]),u("tr",null,[Rut,u("td",null,[u("div",Aut,[le(u("input",{type:"text",id:"petals_base_url",required:"","onUpdate:modelValue":e[182]||(e[182]=h=>r.configFile.petals_base_url=h),onChange:e[183]||(e[183]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.petals_base_url]])])])])])]),_:1}),Ie(o,{title:"Elastic search Service (under construction)",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",wut,[u("tr",null,[Nut,u("td",null,[u("div",Out,[le(u("input",{type:"checkbox",id:"elastic_search_service",required:"","onUpdate:modelValue":e[184]||(e[184]=h=>r.configFile.elastic_search_service=h),onChange:e[185]||(e[185]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ht,r.configFile.elastic_search_service]])])])]),u("tr",null,[Iut,u("td",null,[u("div",Mut,[u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[186]||(e[186]=(...h)=>r.reinstallElasticSearchService&&r.reinstallElasticSearchService(...h))},"install ElasticSearch service")])])]),u("tr",null,[Dut,u("td",null,[u("div",kut,[le(u("input",{type:"text",id:"elastic_search_url",required:"","onUpdate:modelValue":e[187]||(e[187]=h=>r.configFile.elastic_search_url=h),onChange:e[188]||(e[188]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.elastic_search_url]])])])])])]),_:1}),Ie(o,{title:"XTTS service",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",Lut,[u("tr",null,[Put,u("td",null,[u("div",Uut,[le(u("input",{type:"checkbox",id:"enable_voice_service",required:"","onUpdate:modelValue":e[189]||(e[189]=h=>r.configFile.enable_voice_service=h),onChange:e[190]||(e[190]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ht,r.configFile.enable_voice_service]])])])]),u("tr",null,[Fut,u("td",null,[u("div",But,[u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[191]||(e[191]=(...h)=>r.reinstallAudioService&&r.reinstallAudioService(...h))},"install xtts service"),u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[192]||(e[192]=(...h)=>r.startAudioService&&r.startAudioService(...h))},"start xtts service")])])]),u("tr",null,[Gut,u("td",null,[u("div",zut,[le(u("input",{type:"text",id:"xtts_base_url",required:"","onUpdate:modelValue":e[193]||(e[193]=h=>r.configFile.xtts_base_url=h),onChange:e[194]||(e[194]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.xtts_base_url]])])])]),u("tr",null,[Vut,u("td",null,[u("div",Hut,[le(u("select",{"onUpdate:modelValue":e[195]||(e[195]=h=>r.current_language=h),onChange:e[196]||(e[196]=h=>s.settingsChanged=!0),disabled:!r.enable_voice_service},[(w(!0),M($e,null,ct(s.voice_languages,(h,E)=>(w(),M("option",{key:E,value:h},ge(E),9,Yut))),128))],40,qut),[[zn,r.current_language]])])])]),u("tr",null,[$ut,u("td",null,[u("div",Wut,[le(u("select",{"onUpdate:modelValue":e[197]||(e[197]=h=>r.current_voice=h),onChange:e[198]||(e[198]=h=>s.settingsChanged=!0),disabled:!r.enable_voice_service},[(w(!0),M($e,null,ct(s.voices,h=>(w(),M("option",{key:h,value:h},ge(h),9,jut))),128))],40,Kut),[[zn,r.current_voice]])])])]),u("tr",null,[Qut,u("td",null,[u("div",Xut,[le(u("input",{type:"checkbox",id:"auto_read",required:"","onUpdate:modelValue":e[199]||(e[199]=h=>r.configFile.auto_read=h),onChange:e[200]||(e[200]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",disabled:!r.enable_voice_service},null,40,Zut),[[ht,r.configFile.auto_read]])])])])])]),_:1})],2)]),u("div",Jut,[u("div",ept,[u("button",{onClick:e[201]||(e[201]=Te(h=>s.bzc_collapsed=!s.bzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[le(u("div",null,npt,512),[[Mt,s.bzc_collapsed]]),le(u("div",null,spt,512),[[Mt,!s.bzc_collapsed]]),rpt,r.configFile.binding_name?q("",!0):(w(),M("div",opt,[apt,Ze(" No binding selected! ")])),r.configFile.binding_name?(w(),M("div",lpt,"|")):q("",!0),r.configFile.binding_name?(w(),M("div",cpt,[u("div",dpt,[u("img",{src:r.imgBinding,class:"w-8 h-8 rounded-full object-fill text-blue-700"},null,8,upt),u("h3",ppt,ge(r.binding_name),1)])])):q("",!0)])]),u("div",{class:Ye([{hidden:s.bzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[r.bindingsZoo&&r.bindingsZoo.length>0?(w(),M("div",_pt,[u("label",hpt," Bindings: ("+ge(r.bindingsZoo.length)+") ",1),u("div",{class:Ye(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",s.bzl_collapsed?"":"max-h-96"])},[Ie(zi,{name:"list"},{default:Je(()=>[(w(!0),M($e,null,ct(r.bindingsZoo,(h,E)=>(w(),xt(a,{ref_for:!0,ref:"bindingZoo",key:"index-"+E+"-"+h.folder,binding:h,"on-selected":r.onBindingSelected,"on-reinstall":r.onReinstallBinding,"on-unInstall":r.onUnInstallBinding,"on-install":r.onInstallBinding,"on-settings":r.onSettingsBinding,"on-reload-binding":r.onReloadBinding,selected:h.folder===r.configFile.binding_name},null,8,["binding","on-selected","on-reinstall","on-unInstall","on-install","on-settings","on-reload-binding","selected"]))),128))]),_:1})],2)])):q("",!0),s.bzl_collapsed?(w(),M("button",{key:1,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[202]||(e[202]=h=>s.bzl_collapsed=!s.bzl_collapsed)},mpt)):(w(),M("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[203]||(e[203]=h=>s.bzl_collapsed=!s.bzl_collapsed)},bpt))],2)]),u("div",Ept,[u("div",vpt,[u("button",{onClick:e[204]||(e[204]=Te(h=>r.modelsZooToggleCollapse(),["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[le(u("div",null,Spt,512),[[Mt,s.mzc_collapsed]]),le(u("div",null,xpt,512),[[Mt,!s.mzc_collapsed]]),Cpt,u("div",Rpt,[r.configFile.binding_name?q("",!0):(w(),M("div",Apt,[wpt,Ze(" Select binding first! ")])),!r.configFile.model_name&&r.configFile.binding_name?(w(),M("div",Npt,[Opt,Ze(" No model selected! ")])):q("",!0),r.configFile.model_name?(w(),M("div",Ipt,"|")):q("",!0),r.configFile.model_name?(w(),M("div",Mpt,[u("div",Dpt,[u("img",{src:r.imgModel,class:"w-8 h-8 rounded-lg object-fill"},null,8,kpt),u("h3",Lpt,ge(r.configFile.model_name),1)])])):q("",!0)])])]),u("div",{class:Ye([{hidden:s.mzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[u("div",Ppt,[u("div",Upt,[u("div",Fpt,[s.searchModelInProgress?(w(),M("div",Bpt,zpt)):q("",!0),s.searchModelInProgress?q("",!0):(w(),M("div",Vpt,qpt))]),le(u("input",{type:"search",class:"block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Search models...",required:"","onUpdate:modelValue":e[205]||(e[205]=h=>s.searchModel=h),onKeyup:e[206]||(e[206]=Ar((...h)=>r.searchModel_func&&r.searchModel_func(...h),["enter"]))},null,544),[[Pe,s.searchModel]]),s.searchModel?(w(),M("button",{key:0,onClick:e[207]||(e[207]=Te(h=>s.searchModel="",["stop"])),type:"button",class:"text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"}," Clear search")):q("",!0)])]),u("div",null,[le(u("input",{"onUpdate:modelValue":e[208]||(e[208]=h=>s.show_only_installed_models=h),class:"m-2 p-2",type:"checkbox",ref:"only_installed"},null,512),[[ht,s.show_only_installed_models]]),Ypt]),u("div",null,[Ie(l,{radioOptions:s.sortOptions,onRadioSelected:r.handleRadioSelected},null,8,["radioOptions","onRadioSelected"])]),$pt,s.is_loading_zoo?(w(),M("div",Wpt,Qpt)):q("",!0),s.models_zoo&&s.models_zoo.length>0?(w(),M("div",Xpt,[u("label",Zpt," Models: ("+ge(s.models_zoo.length)+") ",1),u("div",{class:Ye(["overflow-y-auto p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 overflow-y-scroll w-full dark:bg-bg-dark 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",s.mzl_collapsed?"":"max-h-96"])},[Ie(zi,{name:"list"},{default:Je(()=>[(w(!0),M($e,null,ct(r.rendered_models_zoo,(h,E)=>(w(),xt(d,{ref_for:!0,ref:"modelZoo",key:"index-"+E+"-"+h.name,model:h,"is-installed":h.isInstalled,"on-install":r.onInstall,"on-uninstall":r.onUninstall,"on-selected":r.onModelSelected,selected:h.name===r.configFile.model_name,model_type:h.model_type,"on-copy":r.onCopy,"on-copy-link":r.onCopyLink,"on-cancel-install":r.onCancelInstall},null,8,["model","is-installed","on-install","on-uninstall","on-selected","selected","model_type","on-copy","on-copy-link","on-cancel-install"]))),128)),u("button",{ref:"load_more_models",class:"relative items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 select-none",onClick:e[209]||(e[209]=(...h)=>r.load_more_models&&r.load_more_models(...h))},"Load more models",512)]),_:1})],2)])):q("",!0),s.mzl_collapsed?(w(),M("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[210]||(e[210]=(...h)=>r.open_mzl&&r.open_mzl(...h))},e_t)):(w(),M("button",{key:3,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[211]||(e[211]=(...h)=>r.open_mzl&&r.open_mzl(...h))},n_t)),u("div",i_t,[u("div",s_t,[u("div",null,[u("div",r_t,[o_t,le(u("input",{type:"text","onUpdate:modelValue":e[212]||(e[212]=h=>s.reference_path=h),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter Path ...",required:""},null,512),[[Pe,s.reference_path]])]),u("button",{type:"button",onClick:e[213]||(e[213]=Te(h=>r.onCreateReference(),["stop"])),class:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},"Add reference")]),s.modelDownlaodInProgress?q("",!0):(w(),M("div",a_t,[u("div",l_t,[c_t,le(u("input",{type:"text","onUpdate:modelValue":e[214]||(e[214]=h=>s.addModel.url=h),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter URL ...",required:""},null,512),[[Pe,s.addModel.url]])]),u("button",{type:"button",onClick:e[215]||(e[215]=Te(h=>r.onInstallAddModel(),["stop"])),class:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},"Download")])),s.modelDownlaodInProgress?(w(),M("div",d_t,[u_t,u("div",p_t,[u("div",__t,[u("div",h_t,[f_t,u("span",m_t,ge(Math.floor(s.addModel.progress))+"%",1)]),u("div",{class:"mx-1 opacity-80 line-clamp-1",title:s.addModel.url},ge(s.addModel.url),9,g_t),u("div",b_t,[u("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Jt({width:s.addModel.progress+"%"})},null,4)]),u("div",E_t,[u("span",v_t,"Download speed: "+ge(r.speed_computed)+"/s",1),u("span",y_t,ge(r.downloaded_size_computed)+"/"+ge(r.total_size_computed),1)])])]),u("div",S_t,[u("div",T_t,[u("div",x_t,[u("button",{onClick:e[216]||(e[216]=Te((...h)=>r.onCancelInstall&&r.onCancelInstall(...h),["stop"])),type:"button",title:"Cancel download",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"}," Cancel ")])])])])):q("",!0)])])],2)]),u("div",C_t,[u("div",R_t,[u("button",{onClick:e[219]||(e[219]=Te(h=>s.pzc_collapsed=!s.pzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[le(u("div",null,w_t,512),[[Mt,s.pzc_collapsed]]),le(u("div",null,O_t,512),[[Mt,!s.pzc_collapsed]]),I_t,r.configFile.personalities?(w(),M("div",M_t,"|")):q("",!0),u("div",D_t,ge(r.active_pesonality),1),r.configFile.personalities?(w(),M("div",k_t,"|")):q("",!0),r.configFile.personalities?(w(),M("div",L_t,[r.mountedPersArr.length>0?(w(),M("div",P_t,[(w(!0),M($e,null,ct(r.mountedPersArr,(h,E)=>(w(),M("div",{class:"relative hover:-translate-y-2 duration-300 hover:z-10 shrink-0",key:E+"-"+h.name,ref_for:!0,ref:"mountedPersonalities"},[u("div",U_t,[u("button",{onClick:Te(b=>r.onPersonalitySelected(h),["stop"])},[u("img",{src:s.bUrl+h.avatar,onError:e[217]||(e[217]=(...b)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...b)),class:Ye(["w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 group-hover:border-secondary",r.configFile.active_personality_id==r.configFile.personalities.indexOf(h.full_path)?"border-secondary":"border-transparent z-0"]),title:h.name},null,42,B_t)],8,F_t),u("button",{onClick:Te(b=>r.unmountPersonality(h),["stop"])},V_t,8,G_t)])]))),128))])):q("",!0)])):q("",!0),u("button",{onClick:e[218]||(e[218]=Te(h=>r.unmountAll(),["stop"])),class:"bg-bg-light hover:border-green-200 ml-5 dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount All"},q_t)])]),u("div",{class:Ye([{hidden:s.pzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[u("div",Y_t,[$_t,u("div",W_t,[u("div",K_t,[s.searchPersonalityInProgress?(w(),M("div",j_t,X_t)):q("",!0),s.searchPersonalityInProgress?q("",!0):(w(),M("div",Z_t,eht))]),le(u("input",{type:"search",id:"personality-search",class:"block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Search personality...",required:"","onUpdate:modelValue":e[220]||(e[220]=h=>s.searchPersonality=h),onKeyup:e[221]||(e[221]=Te((...h)=>r.searchPersonality_func&&r.searchPersonality_func(...h),["stop"]))},null,544),[[Pe,s.searchPersonality]]),s.searchPersonality?(w(),M("button",{key:0,onClick:e[222]||(e[222]=Te(h=>s.searchPersonality="",["stop"])),type:"button",class:"text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"}," Clear search")):q("",!0)])]),s.searchPersonality?q("",!0):(w(),M("div",tht,[u("label",nht," Personalities Category: ("+ge(s.persCatgArr.length)+") ",1),u("select",{id:"persCat",onChange:e[223]||(e[223]=h=>r.update_personality_category(h.target.value,r.refresh)),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(w(!0),M($e,null,ct(s.persCatgArr,(h,E)=>(w(),M("option",{key:E,selected:h==this.configFile.personality_category},ge(h),9,iht))),128))],32)])),u("div",null,[s.personalitiesFiltered.length>0?(w(),M("div",sht,[u("label",rht,ge(s.searchPersonality?"Search results":"Personalities")+": ("+ge(s.personalitiesFiltered.length)+") ",1),u("div",{class:Ye(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",s.pzl_collapsed?"":"max-h-96"])},[Ie(zi,{name:"bounce"},{default:Je(()=>[(w(!0),M($e,null,ct(s.personalitiesFiltered,(h,E)=>(w(),xt(c,{ref_for:!0,ref:"personalitiesZoo",key:"index-"+E+"-"+h.name,personality:h,select_language:!0,full_path:h.full_path,selected:r.configFile.active_personality_id==r.configFile.personalities.findIndex(b=>b===h.full_path||b===h.full_path+":"+h.language),"on-selected":r.onPersonalitySelected,"on-mount":r.mountPersonality,"on-un-mount":r.unmountPersonality,"on-remount":r.remountPersonality,"on-edit":r.editPersonality,"on-copy-to-custom":r.copyToCustom,"on-reinstall":r.onPersonalityReinstall,"on-settings":r.onSettingsPersonality,"on-copy-personality-name":r.onCopyPersonalityName},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"]))),128))]),_:1})],2)])):q("",!0)]),s.pzl_collapsed?(w(),M("button",{key:1,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[224]||(e[224]=h=>s.pzl_collapsed=!s.pzl_collapsed)},aht)):(w(),M("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[225]||(e[225]=h=>s.pzl_collapsed=!s.pzl_collapsed)},cht))],2)]),u("div",dht,[u("div",uht,[u("button",{onClick:e[227]||(e[227]=Te(h=>s.ezc_collapsed=!s.ezc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[le(u("div",null,_ht,512),[[Mt,s.ezc_collapsed]]),le(u("div",null,fht,512),[[Mt,!s.ezc_collapsed]]),mht,r.configFile.extensions?(w(),M("div",ght,"|")):q("",!0),r.configFile.extensions?(w(),M("div",bht,[r.mountedExtensions.length>0?(w(),M("div",Eht,[(w(!0),M($e,null,ct(r.mountedExtensions,(h,E)=>(w(),M("div",{class:"relative hover:-translate-y-2 duration-300 hover:z-10 shrink-0",key:E+"-"+h.name,ref_for:!0,ref:"mountedExtensions"},[u("div",vht,[u("button",null,[u("img",{src:s.bUrl+h.avatar,onError:e[226]||(e[226]=(...b)=>r.extensionImgPlacehodler&&r.extensionImgPlacehodler(...b)),class:Ye(["w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 group-hover:border-secondary","border-transparent z-0"]),title:h.name},null,40,yht)]),u("button",{onClick:Te(b=>r.unmountExtension(h),["stop"])},xht,8,Sht)])]))),128))])):q("",!0)])):q("",!0)])]),u("div",{class:Ye([{hidden:s.ezc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[u("div",Cht,[Rht,u("div",Aht,[u("div",wht,[s.searchExtensionInProgress?(w(),M("div",Nht,Iht)):q("",!0),s.searchExtensionInProgress?q("",!0):(w(),M("div",Mht,kht))]),le(u("input",{type:"search",id:"personality-search",class:"block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Search extension...",required:"","onUpdate:modelValue":e[228]||(e[228]=h=>s.searchExtension=h),onKeyup:e[229]||(e[229]=Te((...h)=>n.searchExtension_func&&n.searchExtension_func(...h),["stop"]))},null,544),[[Pe,s.searchExtension]]),s.searchExtension?(w(),M("button",{key:0,onClick:e[230]||(e[230]=Te(h=>s.searchExtension="",["stop"])),type:"button",class:"text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"}," Clear search")):q("",!0)])]),s.searchExtension?q("",!0):(w(),M("div",Lht,[u("label",Pht," Extensions Category: ("+ge(s.extCatgArr.length)+") ",1),u("select",{id:"extCat",onChange:e[231]||(e[231]=h=>r.update_extension_category(h.target.value,r.refresh)),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(w(!0),M($e,null,ct(s.extCatgArr,(h,E)=>(w(),M("option",{key:E,selected:h==this.extension_category},ge(h),9,Uht))),128))],32)])),u("div",null,[s.extensionsFiltered.length>0?(w(),M("div",Fht,[u("label",Bht,ge(s.searchExtension?"Search results":"Personalities")+": ("+ge(s.extensionsFiltered.length)+") ",1),u("div",{class:Ye(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",s.ezl_collapsed?"":"max-h-96"])},[(w(!0),M($e,null,ct(s.extensionsFiltered,(h,E)=>(w(),xt(_,{ref_for:!0,ref:"extensionsZoo",key:"index-"+E+"-"+h.name,extension:h,select_language:!0,full_path:h.full_path,"on-mount":r.mountExtension,"on-un-mount":r.unmountExtension,"on-remount":r.remountExtension,"on-reinstall":r.onExtensionReinstall,"on-settings":r.onSettingsExtension},null,8,["extension","full_path","on-mount","on-un-mount","on-remount","on-reinstall","on-settings"]))),128))],2)])):q("",!0)]),s.ezc_collapsed?(w(),M("button",{key:1,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[232]||(e[232]=h=>s.ezl_collapsed=!s.ezl_collapsed)},zht)):(w(),M("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[233]||(e[233]=h=>s.ezl_collapsed=!s.ezl_collapsed)},Hht))],2)]),u("div",qht,[u("div",Yht,[u("button",{onClick:e[234]||(e[234]=Te(h=>s.mep_collapsed=!s.mep_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[le(u("div",null,Wht,512),[[Mt,s.mep_collapsed]]),le(u("div",null,jht,512),[[Mt,!s.mep_collapsed]]),Qht])]),u("div",{class:Ye([{hidden:s.mep_collapsed},"flex flex-col mb-2 px-3 pb-0"])},null,2)]),u("div",Xht,[u("div",Zht,[u("button",{onClick:e[235]||(e[235]=Te(h=>s.mc_collapsed=!s.mc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[le(u("div",null,eft,512),[[Mt,s.mc_collapsed]]),le(u("div",null,nft,512),[[Mt,!s.mc_collapsed]]),ift])]),u("div",{class:Ye([{hidden:s.mc_collapsed},"flex flex-col mb-2 p-2"])},[u("div",sft,[u("div",rft,[le(u("input",{id:"override-model-parameters",type:"checkbox",class:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-700 dark:focus:ring-offset-gray-700 focus:ring-2 dark:bg-gray-600 dark:border-gray-500",onClick:e[236]||(e[236]=Te(()=>{},["stop"])),"onUpdate:modelValue":e[237]||(e[237]=h=>r.configFile.override_personality_model_parameters=h),onChange:e[238]||(e[238]=h=>r.update_setting("override_personality_model_parameters",r.configFile.override_personality_model_parameters))},null,544),[[ht,r.configFile.override_personality_model_parameters]]),oft])]),u("div",{class:Ye(r.configFile.override_personality_model_parameters?"":"pointer-events-none opacity-30")},[u("div",aft,[lft,le(u("input",{type:"text",id:"seed","onUpdate:modelValue":e[239]||(e[239]=h=>r.configFile.seed=h),class:"bg-gray-50 border border-gray-300 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,512),[[Pe,r.configFile.seed]])]),u("div",cft,[u("div",dft,[u("div",uft,[pft,u("p",_ft,[le(u("input",{type:"text",id:"temp-val","onUpdate:modelValue":e[240]||(e[240]=h=>r.configFile.temperature=h),onChange:e[241]||(e[241]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.temperature]])])]),le(u("input",{id:"temperature",onChange:e[242]||(e[242]=h=>s.settingsChanged=!0),type:"range","onUpdate:modelValue":e[243]||(e[243]=h=>r.configFile.temperature=h),min:"0",max:"5",step:"0.1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.temperature]])])]),u("div",hft,[u("div",fft,[u("div",mft,[gft,u("p",bft,[le(u("input",{type:"text",id:"predict-val","onUpdate:modelValue":e[244]||(e[244]=h=>r.configFile.n_predict=h),onChange:e[245]||(e[245]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.n_predict]])])]),le(u("input",{id:"predict",type:"range",onChange:e[246]||(e[246]=h=>s.settingsChanged=!0),"onUpdate:modelValue":e[247]||(e[247]=h=>r.configFile.n_predict=h),min:"0",max:"2048",step:"32",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.n_predict]])])]),u("div",Eft,[u("div",vft,[u("div",yft,[Sft,u("p",Tft,[le(u("input",{type:"text",id:"top_k-val","onUpdate:modelValue":e[248]||(e[248]=h=>r.configFile.top_k=h),onChange:e[249]||(e[249]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.top_k]])])]),le(u("input",{id:"top_k",type:"range",onChange:e[250]||(e[250]=h=>s.settingsChanged=!0),"onUpdate:modelValue":e[251]||(e[251]=h=>r.configFile.top_k=h),min:"0",max:"100",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.top_k]])])]),u("div",xft,[u("div",Cft,[u("div",Rft,[Aft,u("p",wft,[le(u("input",{type:"text",id:"top_p-val","onUpdate:modelValue":e[252]||(e[252]=h=>r.configFile.top_p=h),onChange:e[253]||(e[253]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.top_p]])])]),le(u("input",{id:"top_p",type:"range","onUpdate:modelValue":e[254]||(e[254]=h=>r.configFile.top_p=h),min:"0",max:"1",step:"0.01",onChange:e[255]||(e[255]=h=>s.settingsChanged=!0),class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.top_p]])])]),u("div",Nft,[u("div",Oft,[u("div",Ift,[Mft,u("p",Dft,[le(u("input",{type:"text",id:"repeat_penalty-val","onUpdate:modelValue":e[256]||(e[256]=h=>r.configFile.repeat_penalty=h),onChange:e[257]||(e[257]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.repeat_penalty]])])]),le(u("input",{id:"repeat_penalty",onChange:e[258]||(e[258]=h=>s.settingsChanged=!0),type:"range","onUpdate:modelValue":e[259]||(e[259]=h=>r.configFile.repeat_penalty=h),min:"0",max:"2",step:"0.01",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.repeat_penalty]])])]),u("div",kft,[u("div",Lft,[u("div",Pft,[Uft,u("p",Fft,[le(u("input",{type:"text",id:"repeat_last_n-val","onUpdate:modelValue":e[260]||(e[260]=h=>r.configFile.repeat_last_n=h),onChange:e[261]||(e[261]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.repeat_last_n]])])]),le(u("input",{id:"repeat_last_n",type:"range","onUpdate:modelValue":e[262]||(e[262]=h=>r.configFile.repeat_last_n=h),min:"0",max:"100",step:"1",onChange:e[263]||(e[263]=h=>s.settingsChanged=!0),class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.repeat_last_n]])])])],2)],2)])],2)]),Ie(f,{ref:"addmodeldialog"},null,512),Ie(m,{class:"z-20",show:s.variantSelectionDialogVisible,choices:s.variant_choices,onChoiceSelected:r.onVariantChoiceSelected,onCloseDialog:r.oncloseVariantChoiceDialog,onChoiceValidated:r.onvalidateVariantChoice},null,8,["show","choices","onChoiceSelected","onCloseDialog","onChoiceValidated"])],64)}const Gft=bt(mot,[["render",Bft],["__scopeId","data-v-749e7a9f"]]),zft={components:{ClipBoardTextInput:RE,Card:vc},data(){return{dataset_path:"",max_length:1024,batch_size:4,lr:5e-5,num_epochs:2,selectedFolder:"",selectedDataset:""}},methods:{submitForm(){const n={model_name:this.selectedModel,dataset_file:this.selectedDataset,max_length:this.max_length,batch_size:this.batch_size,lr:this.lr,num_epochs:this.num_epochs,output_dir:this.selectedFolder};De.post("/start_training",n).then(e=>{})},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(n){var t;console.log("here");const e=(t=n.target.files[0])==null?void 0:t.path;console.log(e),e&&(this.selectedFolder=e)},selectDataset(n){const e=n.target.files;e.length>0&&(this.selectedDataset=e[0])}},computed:{selectedModel:{get(){return this.$store.state.selectedModel}},models:{get(){return this.$store.state.modelsArr}}},watch:{model_name(n){console.log("watching model_name",n),this.$refs.clipboardInput.inputValue=n}}},Vft={key:0,class:"container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-2 bg-bg-light-tone dark:bg-bg-dark-tone"},Hft={class:"mb-4"},qft=u("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),Yft=["value"],$ft={class:"mb-4"},Wft=u("label",{for:"dataset_path",class:"text-sm"},"Dataset:",-1),Kft={class:"mb-4"},jft=u("label",{for:"lr",class:"text-sm"},"Learning Rate:",-1),Qft={class:"mb-4"},Xft=u("label",{for:"num_epochs",class:"text-sm"},"Number of Epochs:",-1),Zft={class:"mb-4"},Jft=u("label",{for:"max_length",class:"text-sm"},"Max Length:",-1),emt={class:"mb-4"},tmt=u("label",{for:"batch_size",class:"text-sm"},"Batch Size:",-1),nmt={class:"mb-4"},imt=u("label",{for:"output_dir",class:"text-sm"},"Output Directory:",-1),smt=u("button",{class:"bg-blue-500 text-white px-4 py-2 rounded"},"Start training",-1),rmt={key:1};function omt(n,e,t,i,s,r){const o=ft("Card"),a=ft("ClipBoardTextInput");return r.selectedModel!==null&&r.selectedModel.toLowerCase().includes("gptq")?(w(),M("div",Vft,[u("form",{onSubmit:e[2]||(e[2]=Te((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:""},[Ie(o,{title:"Training configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:Je(()=>[Ie(o,{title:"Model",class:"",isHorizontal:!1},{default:Je(()=>[u("div",Hft,[qft,le(u("select",{"onUpdate:modelValue":e[0]||(e[0]=l=>r.selectedModel=l),onChange:e[1]||(e[1]=(...l)=>n.setModel&&n.setModel(...l)),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},[(w(!0),M($e,null,ct(r.models,l=>(w(),M("option",{key:l,value:l},ge(l),9,Yft))),128))],544),[[zn,r.selectedModel]])])]),_:1}),Ie(o,{title:"Data",isHorizontal:!1},{default:Je(()=>[u("div",$ft,[Wft,Ie(a,{id:"model_path",inputType:"file",value:s.dataset_path,onchange:"selectDataset()"},null,8,["value"])])]),_:1}),Ie(o,{title:"Training",isHorizontal:!1},{default:Je(()=>[u("div",Kft,[jft,Ie(a,{id:"model_path",inputType:"integer",value:s.lr},null,8,["value"])]),u("div",Qft,[Xft,Ie(a,{id:"model_path",inputType:"integer",value:s.num_epochs},null,8,["value"])]),u("div",Zft,[Jft,Ie(a,{id:"model_path",inputType:"integer",value:s.max_length},null,8,["value"])]),u("div",emt,[tmt,Ie(a,{id:"model_path",inputType:"integer",value:s.batch_size},null,8,["value"])])]),_:1}),Ie(o,{title:"Output",isHorizontal:!1},{default:Je(()=>[u("div",nmt,[imt,Ie(a,{id:"model_path",inputType:"text",value:n.output_dir},null,8,["value"])])]),_:1})]),_:1}),Ie(o,{disableHoverAnimation:!0,disableFocus:!0},{default:Je(()=>[smt]),_:1})],32)])):(w(),M("div",rmt,[Ie(o,{title:"Info",class:"",isHorizontal:!1},{default:Je(()=>[Ze(" Only GPTQ models are supported for QLora fine tuning. Please select a GPTQ compatible binding. ")]),_:1})]))}const amt=bt(zft,[["render",omt]]),lmt={components:{ClipBoardTextInput:RE,Card:vc},data(){return{model_name:"jondurbin/airoboros-7b-gpt4",tokenizer_name:"jondurbin/airoboros-7b-gpt4",dataset_path:"",max_length:1024,batch_size:4,lr:5e-5,num_epochs:2,selectedFolder:"",selectedDatasetPath:""}},methods:{submitForm(){this.model_name,this.tokenizer_name,this.selectedDatasetPath,this.max_length,this.batch_size,this.lr,this.num_epochs,this.selectedFolder},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(n){var t;console.log("here");const e=(t=n.target.files[0])==null?void 0:t.path;console.log(e),e&&(this.selectedFolder=e)},selectDatasetPath(n){const e=n.target.files;e.length>0&&(this.selectedDatasetPath=e[0].webkitRelativePath)}}},cmt={class:"container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-2 bg-bg-light-tone dark:bg-bg-dark-tone"},dmt={class:"mb-4"},umt=u("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),pmt={class:"mb-4"},_mt=u("label",{for:"tokenizer_name",class:"text-sm"},"Tokenizer Name:",-1),hmt=u("button",{type:"submit",class:"bg-blue-500 text-white px-4 py-2 rounded"},"Quantize LLM",-1);function fmt(n,e,t,i,s,r){const o=ft("ClipBoardTextInput"),a=ft("Card");return w(),M("div",cmt,[u("form",{onSubmit:e[0]||(e[0]=Te((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:"max-w-md mx-auto"},[Ie(a,{title:"Quantizing configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:Je(()=>[Ie(a,{title:"Model",class:"",isHorizontal:!1},{default:Je(()=>[u("div",dmt,[umt,Ie(o,{id:"model_path",inputType:"text",value:s.model_name},null,8,["value"])]),u("div",pmt,[_mt,Ie(o,{id:"model_path",inputType:"text",value:s.tokenizer_name},null,8,["value"])])]),_:1})]),_:1}),Ie(a,{disableHoverAnimation:!0,disableFocus:!0},{default:Je(()=>[hmt]),_:1})],32)])}const mmt=bt(lmt,[["render",fmt]]),gmt={name:"Discussion",emits:["delete","select","editTitle","makeTitle","checked"],props:{id:Number,title:String,selected:Boolean,loading:Boolean,isCheckbox:Boolean,checkBoxValue:Boolean},setup(){},data(){return{showConfirmation:!1,editTitleMode:!1,makeTitleMode:!1,deleteMode:!1,editTitle:!1,newTitle:String,checkBoxValue_local:!1}},methods:{cancel(){this.editTitleMode=!1,this.makeTitleMode=!1,this.deleteMode=!1,this.showConfirmation=!1},deleteEvent(){this.showConfirmation=!1,this.$emit("delete")},selectEvent(){this.$emit("select")},editTitleEvent(){this.editTitle=!1,this.editTitleMode=!1,this.makeTitleMode=!1,this.deleteMode=!1,this.showConfirmation=!1,this.$emit("editTitle",{title:this.newTitle,id:this.id})},makeTitleEvent(){this.$emit("makeTitle",{id:this.id}),this.showConfirmation=!1},chnageTitle(n){this.newTitle=n},checkedChangeEvent(n,e){this.$emit("checked",n,e)}},mounted(){this.newTitle=this.title,Ve(()=>{qe.replace()})},watch:{showConfirmation(){Ve(()=>{qe.replace()})},editTitleMode(n){this.showConfirmation=n,this.editTitle=n,n&&Ve(()=>{try{this.$refs.titleBox.focus()}catch{}})},deleteMode(n){this.showConfirmation=n,n&&Ve(()=>{this.$refs.titleBox.focus()})},makeTitleMode(n){this.showConfirmation=n},checkBoxValue(n,e){this.checkBoxValue_local=n}}},bmt=["id"],Emt={class:"flex flex-row items-center gap-2"},vmt={key:0},ymt=["title"],Smt=["value"],Tmt={class:"flex items-center flex-1 max-h-6"},xmt={key:0,class:"flex gap-3 flex-1 items-center justify-end duration-75"},Cmt=u("i",{"data-feather":"x"},null,-1),Rmt=[Cmt],Amt=u("i",{"data-feather":"check"},null,-1),wmt=[Amt],Nmt={key:1,class:"flex gap-3 flex-1 items-center justify-end invisible group-hover:visible duration-75"},Omt=u("i",{"data-feather":"type"},null,-1),Imt=[Omt],Mmt=u("i",{"data-feather":"edit-2"},null,-1),Dmt=[Mmt],kmt=u("i",{"data-feather":"trash"},null,-1),Lmt=[kmt];function Pmt(n,e,t,i,s,r){return w(),M("div",{class:Ye([t.selected?"bg-bg-light-discussion dark:bg-bg-dark-discussion shadow-md min-w-[23rem] max-w-[23rem]":" min-w-[23rem] max-w-[23rem]","flex flex-row sm:flex-row flex-wrap flex-shrink: 0 item-center shadow-sm gap-2 py-2 my-2 hover:shadow-md hover:bg-primary-light dark:hover:bg-primary rounded-md p-2 duration-75 group cursor-pointer"]),id:"dis-"+t.id,onClick:e[12]||(e[12]=Te(o=>r.selectEvent(),["stop"]))},[u("div",Emt,[t.isCheckbox?(w(),M("div",vmt,[le(u("input",{type:"checkbox",class:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-700 dark:focus:ring-offset-gray-700 focus:ring-2 dark:bg-gray-600 dark:border-gray-500",onClick:e[0]||(e[0]=Te(()=>{},["stop"])),"onUpdate:modelValue":e[1]||(e[1]=o=>s.checkBoxValue_local=o),onInput:e[2]||(e[2]=o=>r.checkedChangeEvent(o,t.id))},null,544),[[ht,s.checkBoxValue_local]])])):q("",!0),t.selected?(w(),M("div",{key:1,class:Ye(["min-h-full w-2 rounded-xl self-stretch",t.loading?"animate-bounce bg-accent ":" bg-secondary "])},null,2)):q("",!0),t.selected?q("",!0):(w(),M("div",{key:2,class:Ye(["w-2",t.loading?"min-h-full w-2 rounded-xl self-stretch animate-bounce bg-accent ":" "])},null,2))]),s.editTitle?q("",!0):(w(),M("p",{key:0,title:t.title,class:"line-clamp-1 w-4/6 ml-1 -mx-5"},ge(t.title?t.title==="untitled"?"New discussion":t.title:"New discussion"),9,ymt)),s.editTitle?(w(),M("input",{key:1,type:"text",id:"title-box",ref:"titleBox",class:"bg-bg-light dark:bg-bg-dark rounded-md border-0 w-full -m-1 p-1",value:t.title,required:"",onKeydown:[e[3]||(e[3]=Ar(Te(o=>r.editTitleEvent(),["exact"]),["enter"])),e[4]||(e[4]=Ar(Te(o=>s.editTitleMode=!1,["exact"]),["esc"]))],onInput:e[5]||(e[5]=o=>r.chnageTitle(o.target.value)),onClick:e[6]||(e[6]=Te(()=>{},["stop"]))},null,40,Smt)):q("",!0),u("div",Tmt,[s.showConfirmation?(w(),M("div",xmt,[u("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Discard title changes",type:"button",onClick:e[7]||(e[7]=Te(o=>r.cancel(),["stop"]))},Rmt),u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm title changes",type:"button",onClick:e[8]||(e[8]=Te(o=>s.editTitleMode?r.editTitleEvent():s.deleteMode?r.deleteEvent():r.makeTitleEvent(),["stop"]))},wmt)])):q("",!0),s.showConfirmation?q("",!0):(w(),M("div",Nmt,[u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Make a title",type:"button",onClick:e[9]||(e[9]=Te(o=>s.makeTitleMode=!0,["stop"]))},Imt),u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Edit title",type:"button",onClick:e[10]||(e[10]=Te(o=>s.editTitleMode=!0,["stop"]))},Dmt),u("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Remove discussion",type:"button",onClick:e[11]||(e[11]=Te(o=>s.deleteMode=!0,["stop"]))},Lmt)]))])],10,bmt)}const wE=bt(gmt,[["render",Pmt]]),Umt={data(){return{show:!1,prompt:"",inputText:""}},methods:{showPanel(){this.show=!0},ok(){this.show=!1,this.$emit("ok",this.inputText)},cancel(){this.show=!1,this.inputText=""}},props:{promptText:{type:String,required:!0}},watch:{promptText(n){this.prompt=n}}},Fmt={key:0,class:"fixed top-0 left-0 w-full h-full flex justify-center items-center bg-black bg-opacity-50"},Bmt={class:"bg-white p-8 rounded"},Gmt={class:"text-xl font-bold mb-4"};function zmt(n,e,t,i,s,r){return w(),M("div",null,[s.show?(w(),M("div",Fmt,[u("div",Bmt,[u("h2",Gmt,ge(t.promptText),1),le(u("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=o=>s.inputText=o),class:"border border-gray-300 px-4 py-2 rounded mb-4"},null,512),[[Pe,s.inputText]]),u("button",{onClick:e[1]||(e[1]=(...o)=>r.ok&&r.ok(...o)),class:"bg-blue-500 text-white px-4 py-2 rounded mr-2"},"OK"),u("button",{onClick:e[2]||(e[2]=(...o)=>r.cancel&&r.cancel(...o)),class:"bg-gray-500 text-white px-4 py-2 rounded"},"Cancel")])])):q("",!0)])}const bO=bt(Umt,[["render",zmt]]),Vmt={data(){return{loading:!1,isCheckbox:!1,isVisible:!1,categories:[],titles:[],content:"",searchQuery:""}},components:{Discussion:wE},methods:{showSkillsLibrary(){this.isVisible=!0,this.fetchCategories()},closeComponent(){this.isVisible=!1},fetchCategories(){De.post("/get_skills_library_categories",{client_id:this.$store.state.client_id}).then(n=>{this.categories=n.data.categories}).catch(n=>{console.error("Error fetching categories:",n)})},fetchTitles(n){console.log("Fetching categories"),De.post("/get_skills_library_titles",{client_id:this.$store.state.client_id,category:n}).then(e=>{this.titles=e.data.titles}).catch(e=>{console.error("Error fetching titles:",e)})},fetchContent(n){De.post("/get_skills_library_content",{client_id:this.$store.state.client_id,skill_id:n}).then(e=>{const t=e.data.contents[0];this.content=t.content}).catch(e=>{console.error("Error fetching content:",e)})},deleteCategory(n){console.log("Delete category")},editCategory(n){console.log("Edit category")},checkUncheckCategory(n){console.log("Unchecked category")},deleteSkill(n){console.log("Delete skill")},editTitle(n){console.log("Edit title")},makeTitle(n){console.log("Make title")},checkUncheckTitle(n){},searchSkills(){}}},Hmt={id:"leftPanel",class:"flex flex-row flex-grow overflow-y-scroll no-scrollbar shadow-lg rounded"},qmt={class:"sticky z-10 top-0 bg-bg-light-tone dark:bg-bg-dark-tone shadow-md"},Ymt={class:"search p-4"},$mt={class:"w-1/4 p-4 max-h-64"},Wmt=u("h2",{class:"text-xl font-bold m-4"},"Categories",-1),Kmt={class:"w-1/4 p-4"},jmt=u("h2",{class:"text-xl font-bold m-4"},"Titles",-1),Qmt={class:"w-full z-0 flex flex-col flex-grow overflow-y-auto 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"},Xmt=u("h2",{class:"text-xl font-bold m-4"},"Content",-1),Zmt={class:"m-4"};function Jmt(n,e,t,i,s,r){const o=ft("Discussion");return w(),M("div",{class:Ye([{hidden:!s.isVisible},"absolute top-20 left-20 bottom-20 right-20 bg-bg-light shadow-lg rounded"])},[u("div",Hmt,[u("div",qmt,[u("div",Ymt,[le(u("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=a=>s.searchQuery=a),placeholder:"Search skills",class:"border border-gray-300 rounded px-2 py-1 mr-2"},null,512),[[Pe,s.searchQuery]]),u("button",{onClick:e[1]||(e[1]=(...a)=>r.searchSkills&&r.searchSkills(...a)),class:"bg-blue-500 text-white rounded px-4 py-1"},"Search")]),u("div",$mt,[Wmt,s.categories.length>0?(w(),xt(zi,{key:0,name:"list"},{default:Je(()=>[(w(!0),M($e,null,ct(s.categories,a=>(w(),xt(o,{key:a,id:a,title:a,selected:r.fetchTitles(a),loading:s.loading,isCheckbox:s.isCheckbox,checkBoxValue:!1,onSelect:l=>r.fetchTitles(a),onDelete:l=>r.deleteCategory(a),onEditTitle:r.editCategory,onMakeTitle:n.makeCategory,onChecked:r.checkUncheckCategory},null,8,["id","title","selected","loading","isCheckbox","onSelect","onDelete","onEditTitle","onMakeTitle","onChecked"]))),128))]),_:1})):q("",!0)]),u("div",Kmt,[jmt,s.categories.length>0?(w(),xt(zi,{key:0,name:"list"},{default:Je(()=>[(w(!0),M($e,null,ct(s.titles,a=>(w(),xt(o,{key:a.id,id:a.id,title:a.title,selected:r.fetchTitles(a),loading:s.loading,isCheckbox:s.isCheckbox,checkBoxValue:!1,onSelect:l=>r.fetchContent(a.id),onDelete:l=>r.deleteSkill(a.id),onEditTitle:r.editTitle,onMakeTitle:r.makeTitle,onChecked:r.checkUncheckTitle},null,8,["id","title","selected","loading","isCheckbox","onSelect","onDelete","onEditTitle","onMakeTitle","onChecked"]))),128))]),_:1})):q("",!0)])]),u("div",Qmt,[Xmt,u("p",Zmt,ge(s.content),1)])]),u("button",{onClick:e[2]||(e[2]=(...a)=>r.closeComponent&&r.closeComponent(...a)),class:"absolute top-2 right-2 bg-red-500 text-white rounded px-2 py-1"},"Close")],2)}const EO=bt(Vmt,[["render",Jmt]]),egt={props:{htmlContent:{type:String,required:!0}}},tgt=["innerHTML"];function ngt(n,e,t,i,s,r){return w(),M("div",null,[u("div",{innerHTML:t.htmlContent},null,8,tgt)])}const igt=bt(egt,[["render",ngt]]);const sgt={props:{jsonData:{type:[Object,Array,String],default:null},jsonFormText:{type:String,default:"JSON Form"}},data(){return{collapsed:!0}},computed:{formattedJson(){return typeof this.jsonData=="string"?JSON.stringify(JSON.parse(this.jsonData),null," ").replace(/\n/g,"
"):JSON.stringify(this.jsonData,null," ").replace(/\n/g,"
")},isObject(){return typeof this.jsonData=="object"&&this.jsonData!==null},isContentPresent(){return this.jsonData!==null&&(typeof this.jsonData!="string"||this.jsonData.trim()!=="")}},methods:{toggleCollapsed(){this.collapsed=!this.collapsed},toggleCollapsible(){this.collapsed=!this.collapsed}}},rgt={key:0},ogt={class:"toggle-icon mr-1"},agt={key:0,class:"fas fa-plus-circle text-gray-600"},lgt={key:1,class:"fas fa-minus-circle text-gray-600"},cgt={class:"json-viewer max-h-64 overflow-auto p-4 bg-gray-100 border border-gray-300 rounded dark:bg-gray-600"},dgt={key:0,class:"fas fa-plus-circle text-gray-600"},ugt={key:1,class:"fas fa-minus-circle text-gray-600"},pgt=["innerHTML"];function _gt(n,e,t,i,s,r){return r.isContentPresent?(w(),M("div",rgt,[u("div",{class:"collapsible-section cursor-pointer mb-4 font-bold hover:text-gray-900",onClick:e[0]||(e[0]=(...o)=>r.toggleCollapsible&&r.toggleCollapsible(...o))},[u("span",ogt,[s.collapsed?(w(),M("i",agt)):(w(),M("i",lgt))]),Ze(" "+ge(t.jsonFormText),1)]),le(u("div",null,[u("div",cgt,[r.isObject?(w(),M("span",{key:0,onClick:e[1]||(e[1]=(...o)=>r.toggleCollapsed&&r.toggleCollapsed(...o)),class:"toggle-icon cursor-pointer mr-1"},[s.collapsed?(w(),M("i",dgt)):(w(),M("i",ugt))])):q("",!0),u("pre",{innerHTML:r.formattedJson},null,8,pgt)])],512),[[Mt,!s.collapsed]])])):q("",!0)}const hgt=bt(sgt,[["render",_gt]]),fgt={props:{done:{type:Boolean,required:!0},message:{type:String,required:!0},status:{type:Boolean,required:!0},step_type:{type:String,required:!1,default:"start_end"}}},mgt={class:"flex items-start"},ggt={class:"step flex items-center mb-4"},bgt={key:0,class:"flex items-center justify-center w-6 h-6 mr-2"},Egt={key:0},vgt=u("i",{"data-feather":"square",class:"text-gray-400 w-4 h-4"},null,-1),ygt=[vgt],Sgt={key:1},Tgt=u("i",{"data-feather":"check-square",class:"text-green-500 w-4 h-4"},null,-1),xgt=[Tgt],Cgt={key:2},Rgt=u("i",{"data-feather":"x-square",class:"text-red-500 w-4 h-4"},null,-1),Agt=[Rgt],wgt={key:1,role:"status",class:"m-15"},Ngt=u("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[u("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),u("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1),Ogt=[Ngt],Igt={class:"text-sm"};function Mgt(n,e,t,i,s,r){return w(),M("div",mgt,[u("div",ggt,[t.step_type=="start_end"?(w(),M("div",bgt,[t.done?q("",!0):(w(),M("div",Egt,ygt)),t.done&&t.status?(w(),M("div",Sgt,xgt)):q("",!0),t.done&&!t.status?(w(),M("div",Cgt,Agt)):q("",!0)])):q("",!0),t.done?q("",!0):(w(),M("div",wgt,Ogt)),u("h3",Igt,ge(t.message),1)])])}const Dgt=bt(fgt,[["render",Mgt]]),kgt="/assets/process-61f7a21b.svg",Lgt="/assets/ok-a0b56451.svg",Pgt="/assets/failed-183609e7.svg",vO="/assets/send_globe-775ba9b7.svg";const Ugt="/",Fgt={name:"Message",emits:["copy","delete","rankUp","rankDown","updateMessage","resendMessage","continueMessage"],components:{MarkdownRenderer:EE,Step:Dgt,RenderHTMLJS:igt,JsonViewer:hgt,DynamicUIRenderer:gO},props:{host:{type:String,required:!1,default:"http://localhost:9600"},message:Object,avatar:{default:""}},data(){return{isSynthesizingVoice:!1,cpp_block:dO,html5_block:uO,LaTeX_block:pO,json_block:cO,javascript_block:lO,process_svg:kgt,ok_svg:Lgt,failed_svg:Pgt,loading_svg:hO,sendGlobe:vO,code_block:oO,python_block:aO,bash_block:_O,audio_url:null,audio:null,msg:null,isSpeaking:!1,speechSynthesis:null,voices:[],expanded:!1,showConfirmation:!1,editMsgMode_:!1,deleteMsgMode:!1,mdRenderHeight:Number}},mounted(){if("speechSynthesis"in window?(this.speechSynthesis=window.speechSynthesis,this.voices=this.speechSynthesis.getVoices(),this.voices.length===0&&this.speechSynthesis.addEventListener("voiceschanged",this.onVoicesChanged)):console.error("Speech synthesis is not supported in this browser."),Ve(()=>{qe.replace(),this.mdRenderHeight=this.$refs.mdRender.$el.offsetHeight}),console.log("Checking metadata"),console.log(this.message),Object.prototype.hasOwnProperty.call(this.message,"metadata")&&this.message.metadata!=null){console.log("Metadata found!"),Array.isArray(this.message.metadata)||(this.message.metadata=[]),console.log(typeof this.message.metadata),console.log(this.message.metadata);for(let n of this.message.metadata)Object.prototype.hasOwnProperty.call(n,"audio_url")&&n.audio_url!=null&&(this.audio_url=n.audio_url,console.log("Audio URL:",this.audio_url))}},methods:{insertTab(n){const e=n.target,t=e.selectionStart,i=e.selectionEnd,s=n.shiftKey;if(t===i)if(s){if(e.value.substring(t-4,t)==" "){const r=e.value.substring(0,t-4),o=e.value.substring(i),a=r+o;this.message.content=a,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t-4})}}else{const r=e.value.substring(0,t),o=e.value.substring(i),a=r+" "+o;this.message.content=a,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t+4})}else{const o=e.value.substring(t,i).split(` +Here is how you can do that`))},Tut)])]),u("tr",null,[xut,u("td",null,[u("div",Cut,[u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[181]||(e[181]=(...h)=>r.reinstallPetalsService&&r.reinstallPetalsService(...h))},"install petals service")])])]),u("tr",null,[Rut,u("td",null,[u("div",Aut,[le(u("input",{type:"text",id:"petals_base_url",required:"","onUpdate:modelValue":e[182]||(e[182]=h=>r.configFile.petals_base_url=h),onChange:e[183]||(e[183]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.petals_base_url]])])])])])]),_:1}),Ie(o,{title:"Elastic search Service (under construction)",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",wut,[u("tr",null,[Nut,u("td",null,[u("div",Out,[le(u("input",{type:"checkbox",id:"elastic_search_service",required:"","onUpdate:modelValue":e[184]||(e[184]=h=>r.configFile.elastic_search_service=h),onChange:e[185]||(e[185]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ht,r.configFile.elastic_search_service]])])])]),u("tr",null,[Iut,u("td",null,[u("div",Mut,[u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[186]||(e[186]=(...h)=>r.reinstallElasticSearchService&&r.reinstallElasticSearchService(...h))},"install ElasticSearch service")])])]),u("tr",null,[Dut,u("td",null,[u("div",kut,[le(u("input",{type:"text",id:"elastic_search_url",required:"","onUpdate:modelValue":e[187]||(e[187]=h=>r.configFile.elastic_search_url=h),onChange:e[188]||(e[188]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.elastic_search_url]])])])])])]),_:1}),Ie(o,{title:"XTTS service",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",Lut,[u("tr",null,[Put,u("td",null,[u("div",Uut,[le(u("input",{type:"checkbox",id:"enable_voice_service",required:"","onUpdate:modelValue":e[189]||(e[189]=h=>r.configFile.enable_voice_service=h),onChange:e[190]||(e[190]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ht,r.configFile.enable_voice_service]])])])]),u("tr",null,[Fut,u("td",null,[u("div",But,[u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[191]||(e[191]=(...h)=>r.reinstallAudioService&&r.reinstallAudioService(...h))},"install xtts service"),u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[192]||(e[192]=(...h)=>r.startAudioService&&r.startAudioService(...h))},"start xtts service")])])]),u("tr",null,[Gut,u("td",null,[u("div",zut,[le(u("input",{type:"text",id:"xtts_base_url",required:"","onUpdate:modelValue":e[193]||(e[193]=h=>r.configFile.xtts_base_url=h),onChange:e[194]||(e[194]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.xtts_base_url]])])])]),u("tr",null,[Vut,u("td",null,[u("div",Hut,[le(u("select",{"onUpdate:modelValue":e[195]||(e[195]=h=>r.current_language=h),onChange:e[196]||(e[196]=h=>s.settingsChanged=!0),disabled:!r.enable_voice_service},[(w(!0),M($e,null,ct(s.voice_languages,(h,E)=>(w(),M("option",{key:E,value:h},ge(E),9,Yut))),128))],40,qut),[[zn,r.current_language]])])])]),u("tr",null,[$ut,u("td",null,[u("div",Wut,[le(u("select",{"onUpdate:modelValue":e[197]||(e[197]=h=>r.current_voice=h),onChange:e[198]||(e[198]=h=>s.settingsChanged=!0),disabled:!r.enable_voice_service},[(w(!0),M($e,null,ct(s.voices,h=>(w(),M("option",{key:h,value:h},ge(h),9,jut))),128))],40,Kut),[[zn,r.current_voice]])])])]),u("tr",null,[Qut,u("td",null,[u("div",Xut,[le(u("input",{type:"checkbox",id:"auto_read",required:"","onUpdate:modelValue":e[199]||(e[199]=h=>r.configFile.auto_read=h),onChange:e[200]||(e[200]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",disabled:!r.enable_voice_service},null,40,Zut),[[ht,r.configFile.auto_read]])])])])])]),_:1})],2)]),u("div",Jut,[u("div",ept,[u("button",{onClick:e[201]||(e[201]=Te(h=>s.bzc_collapsed=!s.bzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[le(u("div",null,npt,512),[[Mt,s.bzc_collapsed]]),le(u("div",null,spt,512),[[Mt,!s.bzc_collapsed]]),rpt,r.configFile.binding_name?q("",!0):(w(),M("div",opt,[apt,Ze(" No binding selected! ")])),r.configFile.binding_name?(w(),M("div",lpt,"|")):q("",!0),r.configFile.binding_name?(w(),M("div",cpt,[u("div",dpt,[u("img",{src:r.imgBinding,class:"w-8 h-8 rounded-full object-fill text-blue-700"},null,8,upt),u("h3",ppt,ge(r.binding_name),1)])])):q("",!0)])]),u("div",{class:Ye([{hidden:s.bzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[r.bindingsZoo&&r.bindingsZoo.length>0?(w(),M("div",_pt,[u("label",hpt," Bindings: ("+ge(r.bindingsZoo.length)+") ",1),u("div",{class:Ye(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",s.bzl_collapsed?"":"max-h-96"])},[Ie(zi,{name:"list"},{default:Je(()=>[(w(!0),M($e,null,ct(r.bindingsZoo,(h,E)=>(w(),xt(a,{ref_for:!0,ref:"bindingZoo",key:"index-"+E+"-"+h.folder,binding:h,"on-selected":r.onBindingSelected,"on-reinstall":r.onReinstallBinding,"on-unInstall":r.onUnInstallBinding,"on-install":r.onInstallBinding,"on-settings":r.onSettingsBinding,"on-reload-binding":r.onReloadBinding,selected:h.folder===r.configFile.binding_name},null,8,["binding","on-selected","on-reinstall","on-unInstall","on-install","on-settings","on-reload-binding","selected"]))),128))]),_:1})],2)])):q("",!0),s.bzl_collapsed?(w(),M("button",{key:1,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[202]||(e[202]=h=>s.bzl_collapsed=!s.bzl_collapsed)},mpt)):(w(),M("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[203]||(e[203]=h=>s.bzl_collapsed=!s.bzl_collapsed)},bpt))],2)]),u("div",Ept,[u("div",vpt,[u("button",{onClick:e[204]||(e[204]=Te(h=>r.modelsZooToggleCollapse(),["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[le(u("div",null,Spt,512),[[Mt,s.mzc_collapsed]]),le(u("div",null,xpt,512),[[Mt,!s.mzc_collapsed]]),Cpt,u("div",Rpt,[r.configFile.binding_name?q("",!0):(w(),M("div",Apt,[wpt,Ze(" Select binding first! ")])),!r.configFile.model_name&&r.configFile.binding_name?(w(),M("div",Npt,[Opt,Ze(" No model selected! ")])):q("",!0),r.configFile.model_name?(w(),M("div",Ipt,"|")):q("",!0),r.configFile.model_name?(w(),M("div",Mpt,[u("div",Dpt,[u("img",{src:r.imgModel,class:"w-8 h-8 rounded-lg object-fill"},null,8,kpt),u("h3",Lpt,ge(r.configFile.model_name),1)])])):q("",!0)])])]),u("div",{class:Ye([{hidden:s.mzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[u("div",Ppt,[u("div",Upt,[u("div",Fpt,[s.searchModelInProgress?(w(),M("div",Bpt,zpt)):q("",!0),s.searchModelInProgress?q("",!0):(w(),M("div",Vpt,qpt))]),le(u("input",{type:"search",class:"block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Search models...",required:"","onUpdate:modelValue":e[205]||(e[205]=h=>s.searchModel=h),onKeyup:e[206]||(e[206]=Ar((...h)=>r.searchModel_func&&r.searchModel_func(...h),["enter"]))},null,544),[[Pe,s.searchModel]]),s.searchModel?(w(),M("button",{key:0,onClick:e[207]||(e[207]=Te(h=>s.searchModel="",["stop"])),type:"button",class:"text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"}," Clear search")):q("",!0)])]),u("div",null,[le(u("input",{"onUpdate:modelValue":e[208]||(e[208]=h=>s.show_only_installed_models=h),class:"m-2 p-2",type:"checkbox",ref:"only_installed"},null,512),[[ht,s.show_only_installed_models]]),Ypt]),u("div",null,[Ie(l,{radioOptions:s.sortOptions,onRadioSelected:r.handleRadioSelected},null,8,["radioOptions","onRadioSelected"])]),$pt,s.is_loading_zoo?(w(),M("div",Wpt,Qpt)):q("",!0),s.models_zoo&&s.models_zoo.length>0?(w(),M("div",Xpt,[u("label",Zpt," Models: ("+ge(s.models_zoo.length)+") ",1),u("div",{class:Ye(["overflow-y-auto p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 overflow-y-scroll w-full dark:bg-bg-dark 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",s.mzl_collapsed?"":"max-h-96"])},[Ie(zi,{name:"list"},{default:Je(()=>[(w(!0),M($e,null,ct(r.rendered_models_zoo,(h,E)=>(w(),xt(d,{ref_for:!0,ref:"modelZoo",key:"index-"+E+"-"+h.name,model:h,"is-installed":h.isInstalled,"on-install":r.onInstall,"on-uninstall":r.onUninstall,"on-selected":r.onModelSelected,selected:h.name===r.configFile.model_name,model_type:h.model_type,"on-copy":r.onCopy,"on-copy-link":r.onCopyLink,"on-cancel-install":r.onCancelInstall},null,8,["model","is-installed","on-install","on-uninstall","on-selected","selected","model_type","on-copy","on-copy-link","on-cancel-install"]))),128)),u("button",{ref:"load_more_models",class:"relative items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 select-none",onClick:e[209]||(e[209]=(...h)=>r.load_more_models&&r.load_more_models(...h))},"Load more models",512)]),_:1})],2)])):q("",!0),s.mzl_collapsed?(w(),M("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[210]||(e[210]=(...h)=>r.open_mzl&&r.open_mzl(...h))},e_t)):(w(),M("button",{key:3,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[211]||(e[211]=(...h)=>r.open_mzl&&r.open_mzl(...h))},n_t)),u("div",i_t,[u("div",s_t,[u("div",null,[u("div",r_t,[o_t,le(u("input",{type:"text","onUpdate:modelValue":e[212]||(e[212]=h=>s.reference_path=h),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter Path ...",required:""},null,512),[[Pe,s.reference_path]])]),u("button",{type:"button",onClick:e[213]||(e[213]=Te(h=>r.onCreateReference(),["stop"])),class:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},"Add reference")]),s.modelDownlaodInProgress?q("",!0):(w(),M("div",a_t,[u("div",l_t,[c_t,le(u("input",{type:"text","onUpdate:modelValue":e[214]||(e[214]=h=>s.addModel.url=h),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter URL ...",required:""},null,512),[[Pe,s.addModel.url]])]),u("button",{type:"button",onClick:e[215]||(e[215]=Te(h=>r.onInstallAddModel(),["stop"])),class:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},"Download")])),s.modelDownlaodInProgress?(w(),M("div",d_t,[u_t,u("div",p_t,[u("div",__t,[u("div",h_t,[f_t,u("span",m_t,ge(Math.floor(s.addModel.progress))+"%",1)]),u("div",{class:"mx-1 opacity-80 line-clamp-1",title:s.addModel.url},ge(s.addModel.url),9,g_t),u("div",b_t,[u("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Jt({width:s.addModel.progress+"%"})},null,4)]),u("div",E_t,[u("span",v_t,"Download speed: "+ge(r.speed_computed)+"/s",1),u("span",y_t,ge(r.downloaded_size_computed)+"/"+ge(r.total_size_computed),1)])])]),u("div",S_t,[u("div",T_t,[u("div",x_t,[u("button",{onClick:e[216]||(e[216]=Te((...h)=>r.onCancelInstall&&r.onCancelInstall(...h),["stop"])),type:"button",title:"Cancel download",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"}," Cancel ")])])])])):q("",!0)])])],2)]),u("div",C_t,[u("div",R_t,[u("button",{onClick:e[219]||(e[219]=Te(h=>s.pzc_collapsed=!s.pzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[le(u("div",null,w_t,512),[[Mt,s.pzc_collapsed]]),le(u("div",null,O_t,512),[[Mt,!s.pzc_collapsed]]),I_t,r.configFile.personalities?(w(),M("div",M_t,"|")):q("",!0),u("div",D_t,ge(r.active_pesonality),1),r.configFile.personalities?(w(),M("div",k_t,"|")):q("",!0),r.configFile.personalities?(w(),M("div",L_t,[r.mountedPersArr.length>0?(w(),M("div",P_t,[(w(!0),M($e,null,ct(r.mountedPersArr,(h,E)=>(w(),M("div",{class:"relative hover:-translate-y-2 duration-300 hover:z-10 shrink-0",key:E+"-"+h.name,ref_for:!0,ref:"mountedPersonalities"},[u("div",U_t,[u("button",{onClick:Te(b=>r.onPersonalitySelected(h),["stop"])},[u("img",{src:s.bUrl+h.avatar,onError:e[217]||(e[217]=(...b)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...b)),class:Ye(["w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 group-hover:border-secondary",r.configFile.active_personality_id==r.configFile.personalities.indexOf(h.full_path)?"border-secondary":"border-transparent z-0"]),title:h.name},null,42,B_t)],8,F_t),u("button",{onClick:Te(b=>r.unmountPersonality(h),["stop"])},V_t,8,G_t)])]))),128))])):q("",!0)])):q("",!0),u("button",{onClick:e[218]||(e[218]=Te(h=>r.unmountAll(),["stop"])),class:"bg-bg-light hover:border-green-200 ml-5 dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount All"},q_t)])]),u("div",{class:Ye([{hidden:s.pzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[u("div",Y_t,[$_t,u("div",W_t,[u("div",K_t,[s.searchPersonalityInProgress?(w(),M("div",j_t,X_t)):q("",!0),s.searchPersonalityInProgress?q("",!0):(w(),M("div",Z_t,eht))]),le(u("input",{type:"search",id:"personality-search",class:"block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Search personality...",required:"","onUpdate:modelValue":e[220]||(e[220]=h=>s.searchPersonality=h),onKeyup:e[221]||(e[221]=Te((...h)=>r.searchPersonality_func&&r.searchPersonality_func(...h),["stop"]))},null,544),[[Pe,s.searchPersonality]]),s.searchPersonality?(w(),M("button",{key:0,onClick:e[222]||(e[222]=Te(h=>s.searchPersonality="",["stop"])),type:"button",class:"text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"}," Clear search")):q("",!0)])]),s.searchPersonality?q("",!0):(w(),M("div",tht,[u("label",nht," Personalities Category: ("+ge(s.persCatgArr.length)+") ",1),u("select",{id:"persCat",onChange:e[223]||(e[223]=h=>r.update_personality_category(h.target.value,r.refresh)),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(w(!0),M($e,null,ct(s.persCatgArr,(h,E)=>(w(),M("option",{key:E,selected:h==this.configFile.personality_category},ge(h),9,iht))),128))],32)])),u("div",null,[s.personalitiesFiltered.length>0?(w(),M("div",sht,[u("label",rht,ge(s.searchPersonality?"Search results":"Personalities")+": ("+ge(s.personalitiesFiltered.length)+") ",1),u("div",{class:Ye(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",s.pzl_collapsed?"":"max-h-96"])},[Ie(zi,{name:"bounce"},{default:Je(()=>[(w(!0),M($e,null,ct(s.personalitiesFiltered,(h,E)=>(w(),xt(c,{ref_for:!0,ref:"personalitiesZoo",key:"index-"+E+"-"+h.name,personality:h,select_language:!0,full_path:h.full_path,selected:r.configFile.active_personality_id==r.configFile.personalities.findIndex(b=>b===h.full_path||b===h.full_path+":"+h.language),"on-selected":r.onPersonalitySelected,"on-mount":r.mountPersonality,"on-un-mount":r.unmountPersonality,"on-remount":r.remountPersonality,"on-edit":r.editPersonality,"on-copy-to-custom":r.copyToCustom,"on-reinstall":r.onPersonalityReinstall,"on-settings":r.onSettingsPersonality,"on-copy-personality-name":r.onCopyPersonalityName},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"]))),128))]),_:1})],2)])):q("",!0)]),s.pzl_collapsed?(w(),M("button",{key:1,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[224]||(e[224]=h=>s.pzl_collapsed=!s.pzl_collapsed)},aht)):(w(),M("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[225]||(e[225]=h=>s.pzl_collapsed=!s.pzl_collapsed)},cht))],2)]),u("div",dht,[u("div",uht,[u("button",{onClick:e[227]||(e[227]=Te(h=>s.ezc_collapsed=!s.ezc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[le(u("div",null,_ht,512),[[Mt,s.ezc_collapsed]]),le(u("div",null,fht,512),[[Mt,!s.ezc_collapsed]]),mht,r.configFile.extensions?(w(),M("div",ght,"|")):q("",!0),r.configFile.extensions?(w(),M("div",bht,[r.mountedExtensions.length>0?(w(),M("div",Eht,[(w(!0),M($e,null,ct(r.mountedExtensions,(h,E)=>(w(),M("div",{class:"relative hover:-translate-y-2 duration-300 hover:z-10 shrink-0",key:E+"-"+h.name,ref_for:!0,ref:"mountedExtensions"},[u("div",vht,[u("button",null,[u("img",{src:s.bUrl+h.avatar,onError:e[226]||(e[226]=(...b)=>r.extensionImgPlacehodler&&r.extensionImgPlacehodler(...b)),class:Ye(["w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 group-hover:border-secondary","border-transparent z-0"]),title:h.name},null,40,yht)]),u("button",{onClick:Te(b=>r.unmountExtension(h),["stop"])},xht,8,Sht)])]))),128))])):q("",!0)])):q("",!0)])]),u("div",{class:Ye([{hidden:s.ezc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[u("div",Cht,[Rht,u("div",Aht,[u("div",wht,[s.searchExtensionInProgress?(w(),M("div",Nht,Iht)):q("",!0),s.searchExtensionInProgress?q("",!0):(w(),M("div",Mht,kht))]),le(u("input",{type:"search",id:"personality-search",class:"block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Search extension...",required:"","onUpdate:modelValue":e[228]||(e[228]=h=>s.searchExtension=h),onKeyup:e[229]||(e[229]=Te((...h)=>n.searchExtension_func&&n.searchExtension_func(...h),["stop"]))},null,544),[[Pe,s.searchExtension]]),s.searchExtension?(w(),M("button",{key:0,onClick:e[230]||(e[230]=Te(h=>s.searchExtension="",["stop"])),type:"button",class:"text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"}," Clear search")):q("",!0)])]),s.searchExtension?q("",!0):(w(),M("div",Lht,[u("label",Pht," Extensions Category: ("+ge(s.extCatgArr.length)+") ",1),u("select",{id:"extCat",onChange:e[231]||(e[231]=h=>r.update_extension_category(h.target.value,r.refresh)),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(w(!0),M($e,null,ct(s.extCatgArr,(h,E)=>(w(),M("option",{key:E,selected:h==this.extension_category},ge(h),9,Uht))),128))],32)])),u("div",null,[s.extensionsFiltered.length>0?(w(),M("div",Fht,[u("label",Bht,ge(s.searchExtension?"Search results":"Personalities")+": ("+ge(s.extensionsFiltered.length)+") ",1),u("div",{class:Ye(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",s.ezl_collapsed?"":"max-h-96"])},[(w(!0),M($e,null,ct(s.extensionsFiltered,(h,E)=>(w(),xt(_,{ref_for:!0,ref:"extensionsZoo",key:"index-"+E+"-"+h.name,extension:h,select_language:!0,full_path:h.full_path,"on-mount":r.mountExtension,"on-un-mount":r.unmountExtension,"on-remount":r.remountExtension,"on-reinstall":r.onExtensionReinstall,"on-settings":r.onSettingsExtension},null,8,["extension","full_path","on-mount","on-un-mount","on-remount","on-reinstall","on-settings"]))),128))],2)])):q("",!0)]),s.ezc_collapsed?(w(),M("button",{key:1,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[232]||(e[232]=h=>s.ezl_collapsed=!s.ezl_collapsed)},zht)):(w(),M("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[233]||(e[233]=h=>s.ezl_collapsed=!s.ezl_collapsed)},Hht))],2)]),u("div",qht,[u("div",Yht,[u("button",{onClick:e[234]||(e[234]=Te(h=>s.mep_collapsed=!s.mep_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[le(u("div",null,Wht,512),[[Mt,s.mep_collapsed]]),le(u("div",null,jht,512),[[Mt,!s.mep_collapsed]]),Qht])]),u("div",{class:Ye([{hidden:s.mep_collapsed},"flex flex-col mb-2 px-3 pb-0"])},null,2)]),u("div",Xht,[u("div",Zht,[u("button",{onClick:e[235]||(e[235]=Te(h=>s.mc_collapsed=!s.mc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[le(u("div",null,eft,512),[[Mt,s.mc_collapsed]]),le(u("div",null,nft,512),[[Mt,!s.mc_collapsed]]),ift])]),u("div",{class:Ye([{hidden:s.mc_collapsed},"flex flex-col mb-2 p-2"])},[u("div",sft,[u("div",rft,[le(u("input",{id:"override-model-parameters",type:"checkbox",class:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-700 dark:focus:ring-offset-gray-700 focus:ring-2 dark:bg-gray-600 dark:border-gray-500",onClick:e[236]||(e[236]=Te(()=>{},["stop"])),"onUpdate:modelValue":e[237]||(e[237]=h=>r.configFile.override_personality_model_parameters=h),onChange:e[238]||(e[238]=h=>r.update_setting("override_personality_model_parameters",r.configFile.override_personality_model_parameters))},null,544),[[ht,r.configFile.override_personality_model_parameters]]),oft])]),u("div",{class:Ye(r.configFile.override_personality_model_parameters?"":"pointer-events-none opacity-30")},[u("div",aft,[lft,le(u("input",{type:"text",id:"seed","onUpdate:modelValue":e[239]||(e[239]=h=>r.configFile.seed=h),class:"bg-gray-50 border border-gray-300 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,512),[[Pe,r.configFile.seed]])]),u("div",cft,[u("div",dft,[u("div",uft,[pft,u("p",_ft,[le(u("input",{type:"text",id:"temp-val","onUpdate:modelValue":e[240]||(e[240]=h=>r.configFile.temperature=h),onChange:e[241]||(e[241]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.temperature]])])]),le(u("input",{id:"temperature",onChange:e[242]||(e[242]=h=>s.settingsChanged=!0),type:"range","onUpdate:modelValue":e[243]||(e[243]=h=>r.configFile.temperature=h),min:"0",max:"5",step:"0.1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.temperature]])])]),u("div",hft,[u("div",fft,[u("div",mft,[gft,u("p",bft,[le(u("input",{type:"text",id:"predict-val","onUpdate:modelValue":e[244]||(e[244]=h=>r.configFile.n_predict=h),onChange:e[245]||(e[245]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.n_predict]])])]),le(u("input",{id:"predict",type:"range",onChange:e[246]||(e[246]=h=>s.settingsChanged=!0),"onUpdate:modelValue":e[247]||(e[247]=h=>r.configFile.n_predict=h),min:"0",max:"2048",step:"32",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.n_predict]])])]),u("div",Eft,[u("div",vft,[u("div",yft,[Sft,u("p",Tft,[le(u("input",{type:"text",id:"top_k-val","onUpdate:modelValue":e[248]||(e[248]=h=>r.configFile.top_k=h),onChange:e[249]||(e[249]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.top_k]])])]),le(u("input",{id:"top_k",type:"range",onChange:e[250]||(e[250]=h=>s.settingsChanged=!0),"onUpdate:modelValue":e[251]||(e[251]=h=>r.configFile.top_k=h),min:"0",max:"100",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.top_k]])])]),u("div",xft,[u("div",Cft,[u("div",Rft,[Aft,u("p",wft,[le(u("input",{type:"text",id:"top_p-val","onUpdate:modelValue":e[252]||(e[252]=h=>r.configFile.top_p=h),onChange:e[253]||(e[253]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.top_p]])])]),le(u("input",{id:"top_p",type:"range","onUpdate:modelValue":e[254]||(e[254]=h=>r.configFile.top_p=h),min:"0",max:"1",step:"0.01",onChange:e[255]||(e[255]=h=>s.settingsChanged=!0),class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.top_p]])])]),u("div",Nft,[u("div",Oft,[u("div",Ift,[Mft,u("p",Dft,[le(u("input",{type:"text",id:"repeat_penalty-val","onUpdate:modelValue":e[256]||(e[256]=h=>r.configFile.repeat_penalty=h),onChange:e[257]||(e[257]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.repeat_penalty]])])]),le(u("input",{id:"repeat_penalty",onChange:e[258]||(e[258]=h=>s.settingsChanged=!0),type:"range","onUpdate:modelValue":e[259]||(e[259]=h=>r.configFile.repeat_penalty=h),min:"0",max:"2",step:"0.01",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.repeat_penalty]])])]),u("div",kft,[u("div",Lft,[u("div",Pft,[Uft,u("p",Fft,[le(u("input",{type:"text",id:"repeat_last_n-val","onUpdate:modelValue":e[260]||(e[260]=h=>r.configFile.repeat_last_n=h),onChange:e[261]||(e[261]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.repeat_last_n]])])]),le(u("input",{id:"repeat_last_n",type:"range","onUpdate:modelValue":e[262]||(e[262]=h=>r.configFile.repeat_last_n=h),min:"0",max:"100",step:"1",onChange:e[263]||(e[263]=h=>s.settingsChanged=!0),class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.repeat_last_n]])])])],2)],2)])],2)]),Ie(f,{ref:"addmodeldialog"},null,512),Ie(m,{class:"z-20",show:s.variantSelectionDialogVisible,choices:s.variant_choices,onChoiceSelected:r.onVariantChoiceSelected,onCloseDialog:r.oncloseVariantChoiceDialog,onChoiceValidated:r.onvalidateVariantChoice},null,8,["show","choices","onChoiceSelected","onCloseDialog","onChoiceValidated"])],64)}const Gft=bt(mot,[["render",Bft],["__scopeId","data-v-749e7a9f"]]),zft={components:{ClipBoardTextInput:RE,Card:vc},data(){return{dataset_path:"",max_length:1024,batch_size:4,lr:5e-5,num_epochs:2,selectedFolder:"",selectedDataset:""}},methods:{submitForm(){const n={model_name:this.selectedModel,dataset_file:this.selectedDataset,max_length:this.max_length,batch_size:this.batch_size,lr:this.lr,num_epochs:this.num_epochs,output_dir:this.selectedFolder};De.post("/start_training",n).then(e=>{})},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(n){var t;console.log("here");const e=(t=n.target.files[0])==null?void 0:t.path;console.log(e),e&&(this.selectedFolder=e)},selectDataset(n){const e=n.target.files;e.length>0&&(this.selectedDataset=e[0])}},computed:{selectedModel:{get(){return this.$store.state.selectedModel}},models:{get(){return this.$store.state.modelsArr}}},watch:{model_name(n){console.log("watching model_name",n),this.$refs.clipboardInput.inputValue=n}}},Vft={key:0,class:"container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-2 bg-bg-light-tone dark:bg-bg-dark-tone"},Hft={class:"mb-4"},qft=u("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),Yft=["value"],$ft={class:"mb-4"},Wft=u("label",{for:"dataset_path",class:"text-sm"},"Dataset:",-1),Kft={class:"mb-4"},jft=u("label",{for:"lr",class:"text-sm"},"Learning Rate:",-1),Qft={class:"mb-4"},Xft=u("label",{for:"num_epochs",class:"text-sm"},"Number of Epochs:",-1),Zft={class:"mb-4"},Jft=u("label",{for:"max_length",class:"text-sm"},"Max Length:",-1),emt={class:"mb-4"},tmt=u("label",{for:"batch_size",class:"text-sm"},"Batch Size:",-1),nmt={class:"mb-4"},imt=u("label",{for:"output_dir",class:"text-sm"},"Output Directory:",-1),smt=u("button",{class:"bg-blue-500 text-white px-4 py-2 rounded"},"Start training",-1),rmt={key:1};function omt(n,e,t,i,s,r){const o=ft("Card"),a=ft("ClipBoardTextInput");return r.selectedModel!==null&&r.selectedModel.toLowerCase().includes("gptq")?(w(),M("div",Vft,[u("form",{onSubmit:e[2]||(e[2]=Te((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:""},[Ie(o,{title:"Training configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:Je(()=>[Ie(o,{title:"Model",class:"",isHorizontal:!1},{default:Je(()=>[u("div",Hft,[qft,le(u("select",{"onUpdate:modelValue":e[0]||(e[0]=l=>r.selectedModel=l),onChange:e[1]||(e[1]=(...l)=>n.setModel&&n.setModel(...l)),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},[(w(!0),M($e,null,ct(r.models,l=>(w(),M("option",{key:l,value:l},ge(l),9,Yft))),128))],544),[[zn,r.selectedModel]])])]),_:1}),Ie(o,{title:"Data",isHorizontal:!1},{default:Je(()=>[u("div",$ft,[Wft,Ie(a,{id:"model_path",inputType:"file",value:s.dataset_path,onchange:"selectDataset()"},null,8,["value"])])]),_:1}),Ie(o,{title:"Training",isHorizontal:!1},{default:Je(()=>[u("div",Kft,[jft,Ie(a,{id:"model_path",inputType:"integer",value:s.lr},null,8,["value"])]),u("div",Qft,[Xft,Ie(a,{id:"model_path",inputType:"integer",value:s.num_epochs},null,8,["value"])]),u("div",Zft,[Jft,Ie(a,{id:"model_path",inputType:"integer",value:s.max_length},null,8,["value"])]),u("div",emt,[tmt,Ie(a,{id:"model_path",inputType:"integer",value:s.batch_size},null,8,["value"])])]),_:1}),Ie(o,{title:"Output",isHorizontal:!1},{default:Je(()=>[u("div",nmt,[imt,Ie(a,{id:"model_path",inputType:"text",value:n.output_dir},null,8,["value"])])]),_:1})]),_:1}),Ie(o,{disableHoverAnimation:!0,disableFocus:!0},{default:Je(()=>[smt]),_:1})],32)])):(w(),M("div",rmt,[Ie(o,{title:"Info",class:"",isHorizontal:!1},{default:Je(()=>[Ze(" Only GPTQ models are supported for QLora fine tuning. Please select a GPTQ compatible binding. ")]),_:1})]))}const amt=bt(zft,[["render",omt]]),lmt={components:{ClipBoardTextInput:RE,Card:vc},data(){return{model_name:"jondurbin/airoboros-7b-gpt4",tokenizer_name:"jondurbin/airoboros-7b-gpt4",dataset_path:"",max_length:1024,batch_size:4,lr:5e-5,num_epochs:2,selectedFolder:"",selectedDatasetPath:""}},methods:{submitForm(){this.model_name,this.tokenizer_name,this.selectedDatasetPath,this.max_length,this.batch_size,this.lr,this.num_epochs,this.selectedFolder},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(n){var t;console.log("here");const e=(t=n.target.files[0])==null?void 0:t.path;console.log(e),e&&(this.selectedFolder=e)},selectDatasetPath(n){const e=n.target.files;e.length>0&&(this.selectedDatasetPath=e[0].webkitRelativePath)}}},cmt={class:"container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-2 bg-bg-light-tone dark:bg-bg-dark-tone"},dmt={class:"mb-4"},umt=u("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),pmt={class:"mb-4"},_mt=u("label",{for:"tokenizer_name",class:"text-sm"},"Tokenizer Name:",-1),hmt=u("button",{type:"submit",class:"bg-blue-500 text-white px-4 py-2 rounded"},"Quantize LLM",-1);function fmt(n,e,t,i,s,r){const o=ft("ClipBoardTextInput"),a=ft("Card");return w(),M("div",cmt,[u("form",{onSubmit:e[0]||(e[0]=Te((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:"max-w-md mx-auto"},[Ie(a,{title:"Quantizing configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:Je(()=>[Ie(a,{title:"Model",class:"",isHorizontal:!1},{default:Je(()=>[u("div",dmt,[umt,Ie(o,{id:"model_path",inputType:"text",value:s.model_name},null,8,["value"])]),u("div",pmt,[_mt,Ie(o,{id:"model_path",inputType:"text",value:s.tokenizer_name},null,8,["value"])])]),_:1})]),_:1}),Ie(a,{disableHoverAnimation:!0,disableFocus:!0},{default:Je(()=>[hmt]),_:1})],32)])}const mmt=bt(lmt,[["render",fmt]]),gmt={name:"Discussion",emits:["delete","select","editTitle","makeTitle","checked"],props:{id:Number,title:String,selected:Boolean,loading:Boolean,isCheckbox:Boolean,checkBoxValue:Boolean},setup(){},data(){return{showConfirmation:!1,editTitleMode:!1,makeTitleMode:!1,deleteMode:!1,editTitle:!1,newTitle:String,checkBoxValue_local:!1}},methods:{cancel(){this.editTitleMode=!1,this.makeTitleMode=!1,this.deleteMode=!1,this.showConfirmation=!1},deleteEvent(){this.showConfirmation=!1,this.$emit("delete")},selectEvent(){this.$emit("select")},editTitleEvent(){this.editTitle=!1,this.editTitleMode=!1,this.makeTitleMode=!1,this.deleteMode=!1,this.showConfirmation=!1,this.$emit("editTitle",{title:this.newTitle,id:this.id})},makeTitleEvent(){this.$emit("makeTitle",{id:this.id}),this.showConfirmation=!1},chnageTitle(n){this.newTitle=n},checkedChangeEvent(n,e){this.$emit("checked",n,e)}},mounted(){this.newTitle=this.title,Ve(()=>{qe.replace()})},watch:{showConfirmation(){Ve(()=>{qe.replace()})},editTitleMode(n){this.showConfirmation=n,this.editTitle=n,n&&Ve(()=>{try{this.$refs.titleBox.focus()}catch{}})},deleteMode(n){this.showConfirmation=n,n&&Ve(()=>{this.$refs.titleBox.focus()})},makeTitleMode(n){this.showConfirmation=n},checkBoxValue(n,e){this.checkBoxValue_local=n}}},bmt=["id"],Emt={class:"flex flex-row items-center gap-2"},vmt={key:0},ymt=["title"],Smt=["value"],Tmt={class:"flex items-center flex-1 max-h-6"},xmt={key:0,class:"flex gap-3 flex-1 items-center justify-end duration-75"},Cmt=u("i",{"data-feather":"x"},null,-1),Rmt=[Cmt],Amt=u("i",{"data-feather":"check"},null,-1),wmt=[Amt],Nmt={key:1,class:"flex gap-3 flex-1 items-center justify-end invisible group-hover:visible duration-75"},Omt=u("i",{"data-feather":"type"},null,-1),Imt=[Omt],Mmt=u("i",{"data-feather":"edit-2"},null,-1),Dmt=[Mmt],kmt=u("i",{"data-feather":"trash"},null,-1),Lmt=[kmt];function Pmt(n,e,t,i,s,r){return w(),M("div",{class:Ye([t.selected?"bg-bg-light-discussion dark:bg-bg-dark-discussion shadow-md min-w-[23rem] max-w-[23rem]":" min-w-[23rem] max-w-[23rem]","flex flex-row sm:flex-row flex-wrap flex-shrink: 0 item-center shadow-sm gap-2 py-2 my-2 hover:shadow-md hover:bg-primary-light dark:hover:bg-primary rounded-md p-2 duration-75 group cursor-pointer"]),id:"dis-"+t.id,onClick:e[12]||(e[12]=Te(o=>r.selectEvent(),["stop"]))},[u("div",Emt,[t.isCheckbox?(w(),M("div",vmt,[le(u("input",{type:"checkbox",class:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-700 dark:focus:ring-offset-gray-700 focus:ring-2 dark:bg-gray-600 dark:border-gray-500",onClick:e[0]||(e[0]=Te(()=>{},["stop"])),"onUpdate:modelValue":e[1]||(e[1]=o=>s.checkBoxValue_local=o),onInput:e[2]||(e[2]=o=>r.checkedChangeEvent(o,t.id))},null,544),[[ht,s.checkBoxValue_local]])])):q("",!0),t.selected?(w(),M("div",{key:1,class:Ye(["min-h-full w-2 rounded-xl self-stretch",t.loading?"animate-bounce bg-accent ":" bg-secondary "])},null,2)):q("",!0),t.selected?q("",!0):(w(),M("div",{key:2,class:Ye(["w-2",t.loading?"min-h-full w-2 rounded-xl self-stretch animate-bounce bg-accent ":" "])},null,2))]),s.editTitle?q("",!0):(w(),M("p",{key:0,title:t.title,class:"line-clamp-1 w-4/6 ml-1 -mx-5"},ge(t.title?t.title==="untitled"?"New discussion":t.title:"New discussion"),9,ymt)),s.editTitle?(w(),M("input",{key:1,type:"text",id:"title-box",ref:"titleBox",class:"bg-bg-light dark:bg-bg-dark rounded-md border-0 w-full -m-1 p-1",value:t.title,required:"",onKeydown:[e[3]||(e[3]=Ar(Te(o=>r.editTitleEvent(),["exact"]),["enter"])),e[4]||(e[4]=Ar(Te(o=>s.editTitleMode=!1,["exact"]),["esc"]))],onInput:e[5]||(e[5]=o=>r.chnageTitle(o.target.value)),onClick:e[6]||(e[6]=Te(()=>{},["stop"]))},null,40,Smt)):q("",!0),u("div",Tmt,[s.showConfirmation?(w(),M("div",xmt,[u("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Discard title changes",type:"button",onClick:e[7]||(e[7]=Te(o=>r.cancel(),["stop"]))},Rmt),u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm title changes",type:"button",onClick:e[8]||(e[8]=Te(o=>s.editTitleMode?r.editTitleEvent():s.deleteMode?r.deleteEvent():r.makeTitleEvent(),["stop"]))},wmt)])):q("",!0),s.showConfirmation?q("",!0):(w(),M("div",Nmt,[u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Make a title",type:"button",onClick:e[9]||(e[9]=Te(o=>s.makeTitleMode=!0,["stop"]))},Imt),u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Edit title",type:"button",onClick:e[10]||(e[10]=Te(o=>s.editTitleMode=!0,["stop"]))},Dmt),u("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Remove discussion",type:"button",onClick:e[11]||(e[11]=Te(o=>s.deleteMode=!0,["stop"]))},Lmt)]))])],10,bmt)}const wE=bt(gmt,[["render",Pmt]]),Umt={data(){return{show:!1,prompt:"",inputText:""}},methods:{showPanel(){this.show=!0},ok(){this.show=!1,this.$emit("ok",this.inputText)},cancel(){this.show=!1,this.inputText=""}},props:{promptText:{type:String,required:!0}},watch:{promptText(n){this.prompt=n}}},Fmt={key:0,class:"fixed top-0 left-0 w-full h-full flex justify-center items-center bg-black bg-opacity-50"},Bmt={class:"bg-white p-8 rounded"},Gmt={class:"text-xl font-bold mb-4"};function zmt(n,e,t,i,s,r){return w(),M("div",null,[s.show?(w(),M("div",Fmt,[u("div",Bmt,[u("h2",Gmt,ge(t.promptText),1),le(u("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=o=>s.inputText=o),class:"border border-gray-300 px-4 py-2 rounded mb-4"},null,512),[[Pe,s.inputText]]),u("button",{onClick:e[1]||(e[1]=(...o)=>r.ok&&r.ok(...o)),class:"bg-blue-500 text-white px-4 py-2 rounded mr-2"},"OK"),u("button",{onClick:e[2]||(e[2]=(...o)=>r.cancel&&r.cancel(...o)),class:"bg-gray-500 text-white px-4 py-2 rounded"},"Cancel")])])):q("",!0)])}const bO=bt(Umt,[["render",zmt]]),Vmt={data(){return{loading:!1,isCheckbox:!1,isVisible:!1,categories:[],titles:[],content:"",searchQuery:""}},components:{Discussion:wE},methods:{showSkillsLibrary(){this.isVisible=!0,this.fetchCategories()},closeComponent(){this.isVisible=!1},fetchCategories(){De.post("/get_skills_library_categories",{client_id:this.$store.state.client_id}).then(n=>{this.categories=n.data.categories}).catch(n=>{console.error("Error fetching categories:",n)})},fetchTitles(n){console.log("Fetching categories"),De.post("/get_skills_library_titles",{client_id:this.$store.state.client_id,category:n}).then(e=>{this.titles=e.data.titles}).catch(e=>{console.error("Error fetching titles:",e)})},fetchContent(n){De.post("/get_skills_library_content",{client_id:this.$store.state.client_id,skill_id:n}).then(e=>{const t=e.data.contents[0];this.content=t.content}).catch(e=>{console.error("Error fetching content:",e)})},deleteCategory(n){console.log("Delete category")},editCategory(n){console.log("Edit category")},checkUncheckCategory(n){console.log("Unchecked category")},deleteSkill(n){console.log("Delete skill")},editTitle(n){console.log("Edit title")},makeTitle(n){console.log("Make title")},checkUncheckTitle(n){},searchSkills(){}}},Hmt={id:"leftPanel",class:"flex flex-row flex-grow overflow-y-scroll no-scrollbar shadow-lg rounded"},qmt={class:"sticky z-10 top-0 bg-bg-light-tone dark:bg-bg-dark-tone shadow-md"},Ymt={class:"search p-4"},$mt={class:"w-1/4 p-4"},Wmt=u("h2",{class:"text-xl font-bold m-4"},"Categories",-1),Kmt={class:"w-1/4 p-4"},jmt=u("h2",{class:"text-xl font-bold m-4"},"Titles",-1),Qmt={class:"w-full z-0 flex flex-col flex-grow overflow-y-auto 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"},Xmt=u("h2",{class:"text-xl font-bold m-4"},"Content",-1),Zmt={class:"m-4"};function Jmt(n,e,t,i,s,r){const o=ft("Discussion");return w(),M("div",{class:Ye([{hidden:!s.isVisible},"absolute top-20 left-20 bottom-20 right-20 bg-bg-light shadow-lg rounded"])},[u("div",Hmt,[u("div",qmt,[u("div",Ymt,[le(u("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=a=>s.searchQuery=a),placeholder:"Search skills",class:"border border-gray-300 rounded px-2 py-1 mr-2"},null,512),[[Pe,s.searchQuery]]),u("button",{onClick:e[1]||(e[1]=(...a)=>r.searchSkills&&r.searchSkills(...a)),class:"bg-blue-500 text-white rounded px-4 py-1"},"Search")]),u("div",$mt,[Wmt,s.categories.length>0?(w(),xt(zi,{key:0,name:"list"},{default:Je(()=>[(w(!0),M($e,null,ct(s.categories,a=>(w(),xt(o,{key:a,id:a,title:a,selected:r.fetchTitles(a),loading:s.loading,isCheckbox:s.isCheckbox,checkBoxValue:!1,onSelect:l=>r.fetchTitles(a),onDelete:l=>r.deleteCategory(a),onEditTitle:r.editCategory,onMakeTitle:n.makeCategory,onChecked:r.checkUncheckCategory},null,8,["id","title","selected","loading","isCheckbox","onSelect","onDelete","onEditTitle","onMakeTitle","onChecked"]))),128))]),_:1})):q("",!0)]),u("div",Kmt,[jmt,s.categories.length>0?(w(),xt(zi,{key:0,name:"list"},{default:Je(()=>[(w(!0),M($e,null,ct(s.titles,a=>(w(),xt(o,{key:a.id,id:a.id,title:a.title,selected:r.fetchTitles(a),loading:s.loading,isCheckbox:s.isCheckbox,checkBoxValue:!1,onSelect:l=>r.fetchContent(a.id),onDelete:l=>r.deleteSkill(a.id),onEditTitle:r.editTitle,onMakeTitle:r.makeTitle,onChecked:r.checkUncheckTitle},null,8,["id","title","selected","loading","isCheckbox","onSelect","onDelete","onEditTitle","onMakeTitle","onChecked"]))),128))]),_:1})):q("",!0)])]),u("div",Qmt,[Xmt,u("p",Zmt,ge(s.content),1)])]),u("button",{onClick:e[2]||(e[2]=(...a)=>r.closeComponent&&r.closeComponent(...a)),class:"absolute top-2 right-2 bg-red-500 text-white rounded px-2 py-1"},"Close")],2)}const EO=bt(Vmt,[["render",Jmt]]),egt={props:{htmlContent:{type:String,required:!0}}},tgt=["innerHTML"];function ngt(n,e,t,i,s,r){return w(),M("div",null,[u("div",{innerHTML:t.htmlContent},null,8,tgt)])}const igt=bt(egt,[["render",ngt]]);const sgt={props:{jsonData:{type:[Object,Array,String],default:null},jsonFormText:{type:String,default:"JSON Form"}},data(){return{collapsed:!0}},computed:{formattedJson(){return typeof this.jsonData=="string"?JSON.stringify(JSON.parse(this.jsonData),null," ").replace(/\n/g,"
"):JSON.stringify(this.jsonData,null," ").replace(/\n/g,"
")},isObject(){return typeof this.jsonData=="object"&&this.jsonData!==null},isContentPresent(){return this.jsonData!==null&&(typeof this.jsonData!="string"||this.jsonData.trim()!=="")}},methods:{toggleCollapsed(){this.collapsed=!this.collapsed},toggleCollapsible(){this.collapsed=!this.collapsed}}},rgt={key:0},ogt={class:"toggle-icon mr-1"},agt={key:0,class:"fas fa-plus-circle text-gray-600"},lgt={key:1,class:"fas fa-minus-circle text-gray-600"},cgt={class:"json-viewer max-h-64 overflow-auto p-4 bg-gray-100 border border-gray-300 rounded dark:bg-gray-600"},dgt={key:0,class:"fas fa-plus-circle text-gray-600"},ugt={key:1,class:"fas fa-minus-circle text-gray-600"},pgt=["innerHTML"];function _gt(n,e,t,i,s,r){return r.isContentPresent?(w(),M("div",rgt,[u("div",{class:"collapsible-section cursor-pointer mb-4 font-bold hover:text-gray-900",onClick:e[0]||(e[0]=(...o)=>r.toggleCollapsible&&r.toggleCollapsible(...o))},[u("span",ogt,[s.collapsed?(w(),M("i",agt)):(w(),M("i",lgt))]),Ze(" "+ge(t.jsonFormText),1)]),le(u("div",null,[u("div",cgt,[r.isObject?(w(),M("span",{key:0,onClick:e[1]||(e[1]=(...o)=>r.toggleCollapsed&&r.toggleCollapsed(...o)),class:"toggle-icon cursor-pointer mr-1"},[s.collapsed?(w(),M("i",dgt)):(w(),M("i",ugt))])):q("",!0),u("pre",{innerHTML:r.formattedJson},null,8,pgt)])],512),[[Mt,!s.collapsed]])])):q("",!0)}const hgt=bt(sgt,[["render",_gt]]),fgt={props:{done:{type:Boolean,required:!0},message:{type:String,required:!0},status:{type:Boolean,required:!0},step_type:{type:String,required:!1,default:"start_end"}}},mgt={class:"flex items-start"},ggt={class:"step flex items-center mb-4"},bgt={key:0,class:"flex items-center justify-center w-6 h-6 mr-2"},Egt={key:0},vgt=u("i",{"data-feather":"square",class:"text-gray-400 w-4 h-4"},null,-1),ygt=[vgt],Sgt={key:1},Tgt=u("i",{"data-feather":"check-square",class:"text-green-500 w-4 h-4"},null,-1),xgt=[Tgt],Cgt={key:2},Rgt=u("i",{"data-feather":"x-square",class:"text-red-500 w-4 h-4"},null,-1),Agt=[Rgt],wgt={key:1,role:"status",class:"m-15"},Ngt=u("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[u("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),u("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1),Ogt=[Ngt],Igt={class:"text-sm"};function Mgt(n,e,t,i,s,r){return w(),M("div",mgt,[u("div",ggt,[t.step_type=="start_end"?(w(),M("div",bgt,[t.done?q("",!0):(w(),M("div",Egt,ygt)),t.done&&t.status?(w(),M("div",Sgt,xgt)):q("",!0),t.done&&!t.status?(w(),M("div",Cgt,Agt)):q("",!0)])):q("",!0),t.done?q("",!0):(w(),M("div",wgt,Ogt)),u("h3",Igt,ge(t.message),1)])])}const Dgt=bt(fgt,[["render",Mgt]]),kgt="/assets/process-61f7a21b.svg",Lgt="/assets/ok-a0b56451.svg",Pgt="/assets/failed-183609e7.svg",vO="/assets/send_globe-775ba9b7.svg";const Ugt="/",Fgt={name:"Message",emits:["copy","delete","rankUp","rankDown","updateMessage","resendMessage","continueMessage"],components:{MarkdownRenderer:EE,Step:Dgt,RenderHTMLJS:igt,JsonViewer:hgt,DynamicUIRenderer:gO},props:{host:{type:String,required:!1,default:"http://localhost:9600"},message:Object,avatar:{default:""}},data(){return{isSynthesizingVoice:!1,cpp_block:dO,html5_block:uO,LaTeX_block:pO,json_block:cO,javascript_block:lO,process_svg:kgt,ok_svg:Lgt,failed_svg:Pgt,loading_svg:hO,sendGlobe:vO,code_block:oO,python_block:aO,bash_block:_O,audio_url:null,audio:null,msg:null,isSpeaking:!1,speechSynthesis:null,voices:[],expanded:!1,showConfirmation:!1,editMsgMode_:!1,deleteMsgMode:!1,mdRenderHeight:Number}},mounted(){if("speechSynthesis"in window?(this.speechSynthesis=window.speechSynthesis,this.voices=this.speechSynthesis.getVoices(),this.voices.length===0&&this.speechSynthesis.addEventListener("voiceschanged",this.onVoicesChanged)):console.error("Speech synthesis is not supported in this browser."),Ve(()=>{qe.replace(),this.mdRenderHeight=this.$refs.mdRender.$el.offsetHeight}),console.log("Checking metadata"),console.log(this.message),Object.prototype.hasOwnProperty.call(this.message,"metadata")&&this.message.metadata!=null){console.log("Metadata found!"),Array.isArray(this.message.metadata)||(this.message.metadata=[]),console.log(typeof this.message.metadata),console.log(this.message.metadata);for(let n of this.message.metadata)Object.prototype.hasOwnProperty.call(n,"audio_url")&&n.audio_url!=null&&(this.audio_url=n.audio_url,console.log("Audio URL:",this.audio_url))}},methods:{insertTab(n){const e=n.target,t=e.selectionStart,i=e.selectionEnd,s=n.shiftKey;if(t===i)if(s){if(e.value.substring(t-4,t)==" "){const r=e.value.substring(0,t-4),o=e.value.substring(i),a=r+o;this.message.content=a,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t-4})}}else{const r=e.value.substring(0,t),o=e.value.substring(i),a=r+" "+o;this.message.content=a,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t+4})}else{const o=e.value.substring(t,i).split(` `).map(c=>c.trim()===""?c:s?c.startsWith(" ")?c.substring(4):c:" "+c),a=e.value.substring(0,t),l=e.value.substring(i),d=a+o.join(` `)+l;this.message.content=d,this.$nextTick(()=>{e.selectionStart=t,e.selectionEnd=i+o.length*4})}n.preventDefault()},onVoicesChanged(){this.voices=this.speechSynthesis.getVoices()},read(){this.isSynthesizingVoice?(this.isSynthesizingVoice=!1,this.$refs.audio_player.pause()):(this.isSynthesizingVoice=!0,De.post("./text2Audio",{text:this.message.content}).then(n=>{this.isSynthesizingVoice=!1;let e=n.data.url;console.log(e),this.audio_url=e,this.message.metadata||(this.message.metadata=[]);let t=!1;for(let i of this.message.metadata)Object.prototype.hasOwnProperty.call(i,"audio_url")&&(i.audio_url=this.audio_url,t=!0);t||this.message.metadata.push({audio_url:this.audio_url}),this.$emit("updateMessage",this.message.id,this.message.content,this.audio_url)}).catch(n=>{this.$store.state.toast.showToast(`Error: ${n}`,4,!1),this.isSynthesizingVoice=!1}))},speak(){if(this.msg){this.speechSynthesis.cancel(),this.msg=null,this.isSpeaking=!1;return}let n=0;console.log("voice on"),this.isSpeaking=!0;const e=200;this.message.content,this.msg=new SpeechSynthesisUtterance,this.msg.pitch=this.$store.state.config.audio_pitch,this.voices.length>0&&(this.msg.voice=this.voices.filter(s=>s.name===this.$store.state.config.audio_out_voice)[0]);const t=s=>{let r=this.message.content.substring(s,s+e);const o=[".","!","?",` `];let a=-1;return o.forEach(l=>{const d=r.lastIndexOf(l);d>a&&(a=d)}),a==-1&&(a=r.length),console.log(a),a+s+1},i=()=>{if(this.message.content.includes(".")){const s=t(n),r=this.message.content.substring(n,s);this.msg.text=r,n=s+1,this.msg.onend=o=>{n{i()},1):(this.isSpeaking=!1,console.log("voice off :",this.message.content.length," ",s))},this.speechSynthesis.speak(this.msg)}else setTimeout(()=>{i()},1)};i()},toggleModel(){this.expanded=!this.expanded},addBlock(n){let e=this.$refs.mdTextarea.selectionStart,t=this.$refs.mdTextarea.selectionEnd;e==t?speechSynthesis==0||this.message.content[e-1]==` diff --git a/web/dist/index.html b/web/dist/index.html index a1a44524..f722c5ae 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -6,7 +6,7 @@ LoLLMS WebUI - Welcome - + diff --git a/web/src/components/SkillsViewer.vue b/web/src/components/SkillsViewer.vue index fec00705..2830679e 100644 --- a/web/src/components/SkillsViewer.vue +++ b/web/src/components/SkillsViewer.vue @@ -7,7 +7,7 @@ -
+

Categories