From 289ce192f6cd7c67523c624f634a9299d44f72c3 Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Mon, 4 Mar 2024 00:34:26 +0100 Subject: [PATCH] sync --- web/dist/assets/{index-6a91582f.js => index-5f0ab27e.js} | 2 +- web/dist/index.html | 2 +- web/src/views/PlayGroundView.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename web/dist/assets/{index-6a91582f.js => index-5f0ab27e.js} (99%) diff --git a/web/dist/assets/index-6a91582f.js b/web/dist/assets/index-5f0ab27e.js similarity index 99% rename from web/dist/assets/index-6a91582f.js rename to web/dist/assets/index-5f0ab27e.js index aac9145f..eacb3b77 100644 --- a/web/dist/assets/index-6a91582f.js +++ b/web/dist/assets/index-5f0ab27e.js @@ -83,7 +83,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),re=P,Q=j),q===void 0&& `+this.message.content.slice(e,t)+"\n```\n"+this.message.content.slice(t),e=e+4+n.length):(this.message.content=this.message.content.slice(0,e)+"\n```"+n+` `+this.message.content.slice(e,t)+"\n```\n"+this.message.content.slice(t),p=p+3+n.length),this.$refs.mdTextarea.focus(),this.$refs.mdTextarea.selectionStart=this.$refs.mdTextarea.selectionEnd=p},insertTab(n){const e=n.target,t=e.selectionStart,i=e.selectionEnd,s=e.value.substring(0,t),r=e.value.substring(i),o=s+" "+r;this.text=o,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t+4}),n.preventDefault()},mdTextarea_changed(){console.log("mdTextarea_changed"),this.cursorPosition=this.$refs.mdTextarea.selectionStart},mdTextarea_clicked(){console.log(`mdTextarea_clicked: ${this.$refs.mdTextarea.selectionStart}`),this.cursorPosition=this.$refs.mdTextarea.selectionStart},setModel(){this.selecting_model=!0,Le.post("/update_setting",{setting_name:"model_name",setting_value:this.selectedModel}).then(n=>{console.log(n),n.status&&this.$refs.toast.showToast(`Model changed to ${this.selectedModel}`,4,!0),this.selecting_model=!1}).catch(n=>{this.$refs.toast.showToast(`Error ${n}`,4,!0),this.selecting_model=!1})},onVoicesChanged(){this.voices=this.speechSynthesis.getVoices()},read(){console.log("READING..."),this.isSynthesizingVoice=!0;let n=this.$refs.mdTextarea.selectionStart,e=this.$refs.mdTextarea.selectionEnd,t=this.text;n!=e&&(t=t.slice(n,e)),Le.post("./text2Audio",{text:t}).then(i=>{console.log(i.data.url);let s=i.data.url;this.audio_url=TJe+s,this.isSynthesizingVoice=!1,Ve(()=>{qe.replace()})}).catch(i=>{this.$refs.toast.showToast(`Error: ${i}`,4,!1),this.isSynthesizingVoice=!1,Ve(()=>{qe.replace()})})},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.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.text.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=()=>{const s=t(n),r=this.text.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.text.length," ",s))},this.speechSynthesis.speak(this.msg)};i()},getCursorPosition(){return this.$refs.mdTextarea.selectionStart},appendToOutput(n){this.pre_text+=n,this.text=this.pre_text+this.post_text},generate_in_placeholder(){console.log("Finding cursor position");let n=this.text.indexOf("@@");if(n<0){this.$refs.toast.showToast("No generation placeholder found",4,!1);return}this.text=this.text.substring(0,n)+this.text.substring(n+26,this.text.length),this.pre_text=this.text.substring(0,n),this.post_text=this.text.substring(n,this.text.length);var e=this.text.substring(0,n);console.log(e),je.emit("generate_text",{prompt:e,personality:-1,n_predicts:this.n_predicts,n_crop:this.n_crop,parameters:{temperature:this.temperature,top_k:this.top_k,top_p:this.top_p,repeat_penalty:this.repeat_penalty,repeat_last_n:this.repeat_last_n,seed:parseInt(this.seed)}}),this.generating=!0},async tokenize_text(){const n=await Le.post("/lollms_tokenize",{prompt:this.text},{headers:this.posts_headers});console.log(n.data.named_tokens),this.namedTokens=n.data.named_tokens},generate(){console.log("Finding cursor position"),this.pre_text=this.text.substring(0,this.getCursorPosition()),this.post_text=this.text.substring(this.getCursorPosition(),this.text.length);var n=this.text.substring(0,this.getCursorPosition());console.log(this.text),console.log(`cursor position :${this.getCursorPosition()}`),console.log(`pretext:${this.pre_text}`),console.log(`post_text:${this.post_text}`),console.log(`prompt:${n}`),je.emit("generate_text",{prompt:n,personality:-1,n_predicts:this.n_predicts,n_crop:this.n_crop,parameters:{temperature:this.temperature,top_k:this.top_k,top_p:this.top_p,repeat_penalty:this.repeat_penalty,repeat_last_n:this.repeat_last_n,seed:parseInt(this.seed)}}),this.generating=!0},stopGeneration(){je.emit("cancel_text_generation",{})},exportText(){const n=this.text,e=document.createElement("a"),t=new Blob([n],{type:"text/plain"});e.href=URL.createObjectURL(t),e.download="exported_text.txt",document.body.appendChild(e),e.click(),document.body.removeChild(e)},importText(){const n=document.getElementById("import-input");n&&(n.addEventListener("change",e=>{if(e.target.files&&e.target.files[0]){const t=new FileReader;t.onload=()=>{this.text=t.result},t.readAsText(e.target.files[0])}else alert("Please select a file.")}),n.click())},setPreset(){console.log("Setting preset"),console.log(this.selectedPreset),this.tab_id="render",this.text=xJe(this.selectedPreset.content,n=>{console.log("Done"),console.log(n),this.text=n})},addPreset(){let n=prompt("Enter the title of the preset:");this.presets[n]={name:n,content:this.text},Le.post("./add_preset",this.presets[n]).then(e=>{console.log(e.data)}).catch(e=>{this.$refs.toast.showToast(`Error: ${e}`,4,!1)})},removePreset(){this.selectedPreset&&delete this.presets[this.selectedPreset.name]},reloadPresets(){Le.get("./get_presets").then(n=>{console.log(n.data),this.presets=n.data,this.selectedPreset=this.presets[0]}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)})},startRecording(){this.pending=!0,this.is_recording?Le.get("/stop_recording").then(n=>{this.is_recording=!1,this.pending=!1,console.log(n),this.text+=n.data.text,console.log(n.data),this.presets=n.data,this.selectedPreset=this.presets[0]}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)}):Le.get("/start_recording").then(n=>{this.is_recording=!0,this.pending=!1,console.log(n.data)}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)})},startRecordingAndTranscribing(){this.pending=!0,this.is_deaf_transcribing?Le.get("/stop_recording").then(n=>{this.is_deaf_transcribing=!1,this.pending=!1,this.text=n.data.text,this.read()}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)}):Le.get("/start_recording").then(n=>{this.is_deaf_transcribing=!0,this.pending=!1}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)})},startSpeechRecognition(){"SpeechRecognition"in window||"webkitSpeechRecognition"in window?(this.recognition=new(window.SpeechRecognition||window.webkitSpeechRecognition),this.recognition.lang=this.$store.state.config.audio_in_language,this.recognition.interimResults=!0,this.recognition.onstart=()=>{this.isLesteningToVoice=!0,this.silenceTimer=setTimeout(()=>{this.recognition.stop()},this.silenceTimeout)},this.pre_text=this.text.substring(0,this.getCursorPosition()),this.post_text=this.text.substring(this.getCursorPosition(),this.text.length),this.recognition.onresult=n=>{this.generated="";for(let e=n.resultIndex;e{this.recognition.stop()},this.silenceTimeout)},this.recognition.onerror=n=>{console.error("Speech recognition error:",n.error),this.isLesteningToVoice=!1,clearTimeout(this.silenceTimer)},this.recognition.onend=()=>{console.log("Speech recognition ended."),this.isLesteningToVoice=!1,this.pre_text=this.pre_text+this.generated,this.cursorPosition=this.pre_text.length,clearTimeout(this.silenceTimer)},this.recognition.start()):console.error("Speech recognition is not supported in this browser.")}}},RJe={class:"container bg-bg-light dark:bg-bg-dark shadow-lg 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"},AJe={class:"container flex flex-row m-2"},wJe={class:"flex-grow m-2"},NJe={class:"flex gap-3 flex-1 items-center flex-grow flex-row m-2 p-2 border border-blue-300 rounded-md border-2 border-blue-300 m-2 p-4"},OJe=u("i",{"data-feather":"pen-tool"},null,-1),IJe=[OJe],MJe=u("i",{"data-feather":"archive"},null,-1),DJe=[MJe],kJe=["src"],LJe=u("span",{class:"w-80"},null,-1),PJe=u("i",{"data-feather":"x"},null,-1),UJe=[PJe],FJe=u("i",{"data-feather":"mic"},null,-1),BJe=[FJe],GJe=u("i",{"data-feather":"volume-2"},null,-1),zJe=[GJe],VJe=["src"],HJe=["src"],qJe=["src"],YJe=["src"],$Je=u("i",{"data-feather":"voicemail"},null,-1),WJe=[$Je],KJe={key:1,"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"},jJe=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"},null,-1),QJe=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"},null,-1),XJe=[jJe,QJe],ZJe=u("i",{"data-feather":"upload"},null,-1),JJe=[ZJe],eet=u("i",{"data-feather":"download"},null,-1),tet=[eet],net={class:"flex gap-3 flex-1 items-center flex-grow justify-end"},iet=u("input",{type:"file",id:"import-input",class:"hidden"},null,-1),set={key:0},ret={class:"flex flex-row justify-end mx-2"},oet=["src"],aet=["src"],cet=["src"],det=["src"],uet=["src"],pet=["src"],_et=["src"],het=["src"],fet=u("i",{"data-feather":"copy"},null,-1),met=[fet],get=["src"],bet={key:2},Eet=["value"],vet={key:0,title:"Selecting model",class:"flex flex-row flex-grow justify-end"},yet=u("div",{role:"status"},[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"})]),u("span",{class:"sr-only"},"Selecting model...")],-1),Tet=[yet],xet=["value"],Cet=u("br",null,null,-1),Ret=u("i",{"data-feather":"check"},null,-1),Aet=[Ret],wet=u("i",{"data-feather":"plus"},null,-1),Net=[wet],Oet=u("i",{"data-feather":"x"},null,-1),Iet=[Oet],Met=u("i",{"data-feather":"refresh-ccw"},null,-1),Det=[Met],ket={class:"slider-container ml-2 mr-2"},Let=u("h3",{class:"text-gray-600"},"Temperature",-1),Pet={class:"slider-value text-gray-500"},Uet={class:"slider-container ml-2 mr-2"},Fet=u("h3",{class:"text-gray-600"},"Top K",-1),Bet={class:"slider-value text-gray-500"},Get={class:"slider-container ml-2 mr-2"},zet=u("h3",{class:"text-gray-600"},"Top P",-1),Vet={class:"slider-value text-gray-500"},Het={class:"slider-container ml-2 mr-2"},qet=u("h3",{class:"text-gray-600"},"Repeat Penalty",-1),Yet={class:"slider-value text-gray-500"},$et={class:"slider-container ml-2 mr-2"},Wet=u("h3",{class:"text-gray-600"},"Repeat Last N",-1),Ket={class:"slider-value text-gray-500"},jet={class:"slider-container ml-2 mr-2"},Qet=u("h3",{class:"text-gray-600"},"Number of tokens to crop the text to",-1),Xet={class:"slider-value text-gray-500"},Zet={class:"slider-container ml-2 mr-2"},Jet=u("h3",{class:"text-gray-600"},"Number of tokens to generate",-1),ett={class:"slider-value text-gray-500"},ttt={class:"slider-container ml-2 mr-2"},ntt=u("h3",{class:"text-gray-600"},"Seed",-1),itt={class:"slider-value text-gray-500"};function stt(n,e,t,i,s,r){const o=mt("tokens-hilighter"),a=mt("MarkdownRenderer"),l=mt("Card"),d=mt("Toast");return N(),M($e,null,[u("div",RJe,[u("div",AJe,[u("div",wJe,[u("div",NJe,[ce(u("button",{id:"generate-button",title:"Generate from current cursor position",onClick:e[0]||(e[0]=(...c)=>r.generate&&r.generate(...c)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},IJe,512),[[Mt,!s.generating]]),ce(u("button",{id:"generate-next-button",title:"Generate from next place holder",onClick:e[1]||(e[1]=(...c)=>r.generate_in_placeholder&&r.generate_in_placeholder(...c)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},DJe,512),[[Mt,!s.generating]]),ce(u("button",{id:"tokenize",title:"Tokenize text",onClick:e[2]||(e[2]=(...c)=>r.tokenize_text&&r.tokenize_text(...c)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},[u("img",{width:"25",height:"25",src:s.tokenize_icon},null,8,kJe)],512),[[Mt,!s.generating]]),LJe,ce(u("button",{id:"stop-button",onClick:e[3]||(e[3]=(...c)=>r.stopGeneration&&r.stopGeneration(...c)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},UJe,512),[[Mt,s.generating]]),u("button",{type:"button",title:"Dictate (using your browser for transcription)",onClick:e[4]||(e[4]=(...c)=>r.startSpeechRecognition&&r.startSpeechRecognition(...c)),class:Ye([{"text-red-500":s.isLesteningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"])},BJe,2),u("button",{title:"convert text to audio (not saved and uses your browser tts service)",onClick:e[5]||(e[5]=xe(c=>r.speak(),["stop"])),class:Ye([{"text-red-500":r.isTalking},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"])},zJe,2),u("button",{type:"button",title:"Start audio to audio",onClick:e[6]||(e[6]=(...c)=>r.startRecordingAndTranscribing&&r.startRecordingAndTranscribing(...c)),class:Ye([{"text-green-500":s.isLesteningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer text-red-500"])},[s.pending?W("",!0):(N(),M("img",{key:0,src:s.is_deaf_transcribing?s.deaf_on:s.deaf_off,height:"25"},null,8,VJe)),s.pending?(N(),M("img",{key:1,src:s.loading_icon,height:"25"},null,8,HJe)):W("",!0)],2),u("button",{type:"button",title:"Start recording audio",onClick:e[7]||(e[7]=(...c)=>r.startRecording&&r.startRecording(...c)),class:Ye([{"text-green-500":s.isLesteningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer text-red-500"])},[s.pending?W("",!0):(N(),M("img",{key:0,src:s.is_recording?s.rec_on:s.rec_off,height:"25"},null,8,qJe)),s.pending?(N(),M("img",{key:1,src:s.loading_icon,height:"25"},null,8,YJe)):W("",!0)],2),s.isSynthesizingVoice?(N(),M("svg",KJe,XJe)):(N(),M("button",{key:0,title:"generate audio from the text",onClick:e[8]||(e[8]=xe(c=>r.read(),["stop"])),class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},WJe)),ce(u("button",{id:"export-button",onClick:e[9]||(e[9]=(...c)=>r.exportText&&r.exportText(...c)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},JJe,512),[[Mt,!s.generating]]),ce(u("button",{id:"import-button",onClick:e[10]||(e[10]=(...c)=>r.importText&&r.importText(...c)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},tet,512),[[Mt,!s.generating]]),u("div",net,[u("button",{class:Ye(["border-2 text-blue-600 dark:text-white border-blue-300 p-2 rounded shadow-lg hover:border-gray-600 dark:link-item-dark cursor-pointer",{"bg-blue-200 dark:bg-blue-500":s.tab_id=="source"}]),onClick:e[11]||(e[11]=c=>s.tab_id="source")}," Source ",2),u("button",{class:Ye(["border-2 text-blue-600 dark:text-white border-blue-300 p-2 rounded shadow-lg hover:border-gray-600 dark:link-item-dark cursor-pointer",{"bg-blue-200 dark:bg-blue-500":s.tab_id=="render"}]),onClick:e[12]||(e[12]=c=>s.tab_id="render")}," Render ",2)]),iet]),u("div",{class:Ye(["flex-grow m-2 p-2 border border-blue-300 rounded-md border-2 border-blue-300 m-2 p-4",{"border-red-500":s.generating}])},[s.tab_id==="source"?(N(),M("div",set,[u("div",ret,[u("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add generic block",onClick:e[13]||(e[13]=xe(c=>r.addBlock(""),["stop"]))},[u("img",{src:s.code_block,width:"25",height:"25"},null,8,oet)]),u("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add python block",onClick:e[14]||(e[14]=xe(c=>r.addBlock("python"),["stop"]))},[u("img",{src:s.python_block,width:"25",height:"25"},null,8,aet)]),u("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add javascript block",onClick:e[15]||(e[15]=xe(c=>r.addBlock("javascript"),["stop"]))},[u("img",{src:s.javascript_block,width:"25",height:"25"},null,8,cet)]),u("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add json block",onClick:e[16]||(e[16]=xe(c=>r.addBlock("json"),["stop"]))},[u("img",{src:s.json_block,width:"25",height:"25"},null,8,det)]),u("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add c++ block",onClick:e[17]||(e[17]=xe(c=>r.addBlock("c++"),["stop"]))},[u("img",{src:s.cpp_block,width:"25",height:"25"},null,8,uet)]),u("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add html block",onClick:e[18]||(e[18]=xe(c=>r.addBlock("html"),["stop"]))},[u("img",{src:s.html5_block,width:"25",height:"25"},null,8,pet)]),u("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add LaTex block",onClick:e[19]||(e[19]=xe(c=>r.addBlock("latex"),["stop"]))},[u("img",{src:s.LaTeX_block,width:"25",height:"25"},null,8,_et)]),u("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add bash block",onClick:e[20]||(e[20]=xe(c=>r.addBlock("bash"),["stop"]))},[u("img",{src:s.bash_block,width:"25",height:"25"},null,8,het)]),u("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Copy message to clipboard",onClick:e[21]||(e[21]=xe(c=>n.copyContentToClipboard(),["stop"]))},met)]),ce(u("textarea",{ref:"mdTextarea",onKeydown:e[22]||(e[22]=Ar(xe((...c)=>r.insertTab&&r.insertTab(...c),["prevent"]),["tab"])),class:"block min-h-500 p-2.5 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 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 overflow-y-scroll flex flex-col shadow-lg p-10 pt-0 overflow-y-scroll 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",rows:4,style:Jt({minHeight:s.mdRenderHeight+"px"}),placeholder:"Enter message here...","onUpdate:modelValue":e[23]||(e[23]=c=>s.text=c),onClick:e[24]||(e[24]=xe((...c)=>r.mdTextarea_clicked&&r.mdTextarea_clicked(...c),["prevent"])),onChange:e[25]||(e[25]=xe((...c)=>r.mdTextarea_changed&&r.mdTextarea_changed(...c),["prevent"]))},`\r - `,36),[[Ue,s.text]]),u("span",null,"Cursor position "+ge(s.cursorPosition),1)])):W("",!0),s.audio_url!=null?(N(),M("audio",{controls:"",autoplay:"",key:s.audio_url},[u("source",{src:s.audio_url,type:"audio/wav",ref:"audio_player"},null,8,get),Ze(" Your browser does not support the audio element. ")])):W("",!0),Ie(o,{namedTokens:s.namedTokens},null,8,["namedTokens"]),s.tab_id==="render"?(N(),M("div",bet,[Ie(a,{ref:"mdRender","markdown-text":s.text,class:"mt-4 p-2 rounded shadow-lg dark:bg-bg-dark"},null,8,["markdown-text"])])):W("",!0)],2)]),Ie(l,{title:"settings",class:"slider-container ml-0 mr-0 max-width",isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:nt(()=>[Ie(l,{title:"Model",class:"slider-container ml-0 mr-0",is_subcard:!0,isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:nt(()=>[ce(u("select",{"onUpdate:modelValue":e[26]||(e[26]=c=>r.selectedModel=c),onChange:e[27]||(e[27]=(...c)=>r.setModel&&r.setModel(...c)),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},[(N(!0),M($e,null,dt(r.models,c=>(N(),M("option",{key:c,value:c},ge(c),9,Eet))),128))],544),[[zn,r.selectedModel]]),s.selecting_model?(N(),M("div",vet,Tet)):W("",!0)]),_:1}),Ie(l,{title:"Presets",class:"slider-container ml-0 mr-0",is_subcard:!0,isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:nt(()=>[ce(u("select",{"onUpdate:modelValue":e[28]||(e[28]=c=>s.selectedPreset=c),class:"bg-white dark:bg-black mb-2 border-2 rounded-md shadow-sm w-full"},[(N(!0),M($e,null,dt(s.presets,c=>(N(),M("option",{key:c,value:c},ge(c.name),9,xet))),128))],512),[[zn,s.selectedPreset]]),Cet,u("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[29]||(e[29]=(...c)=>r.setPreset&&r.setPreset(...c)),title:"Use preset"},Aet),u("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[30]||(e[30]=(...c)=>r.addPreset&&r.addPreset(...c)),title:"Add this text as a preset"},Net),u("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[31]||(e[31]=(...c)=>r.removePreset&&r.removePreset(...c)),title:"Remove preset"},Iet),u("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[32]||(e[32]=(...c)=>r.reloadPresets&&r.reloadPresets(...c)),title:"Reload presets list"},Det)]),_:1}),Ie(l,{title:"Generation params",class:"slider-container ml-0 mr-0",is_subcard:!0,isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:nt(()=>[u("div",ket,[Let,ce(u("input",{type:"range","onUpdate:modelValue":e[33]||(e[33]=c=>s.temperature=c),min:"0",max:"5",step:"0.1",class:"w-full"},null,512),[[Ue,s.temperature]]),u("span",Pet,"Current value: "+ge(s.temperature),1)]),u("div",Uet,[Fet,ce(u("input",{type:"range","onUpdate:modelValue":e[34]||(e[34]=c=>s.top_k=c),min:"1",max:"100",step:"1",class:"w-full"},null,512),[[Ue,s.top_k]]),u("span",Bet,"Current value: "+ge(s.top_k),1)]),u("div",Get,[zet,ce(u("input",{type:"range","onUpdate:modelValue":e[35]||(e[35]=c=>s.top_p=c),min:"0",max:"1",step:"0.1",class:"w-full"},null,512),[[Ue,s.top_p]]),u("span",Vet,"Current value: "+ge(s.top_p),1)]),u("div",Het,[qet,ce(u("input",{type:"range","onUpdate:modelValue":e[36]||(e[36]=c=>s.repeat_penalty=c),min:"0",max:"5",step:"0.1",class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[Ue,s.repeat_penalty]]),u("span",Yet,"Current value: "+ge(s.repeat_penalty),1)]),u("div",$et,[Wet,ce(u("input",{type:"range","onUpdate:modelValue":e[37]||(e[37]=c=>s.repeat_last_n=c),min:"0",max:"100",step:"1",class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[Ue,s.repeat_last_n]]),u("span",Ket,"Current value: "+ge(s.repeat_last_n),1)]),u("div",jet,[Qet,ce(u("input",{type:"number","onUpdate:modelValue":e[38]||(e[38]=c=>s.n_crop=c),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[Ue,s.n_crop]]),u("span",Xet,"Current value: "+ge(s.n_crop),1)]),u("div",Zet,[Jet,ce(u("input",{type:"number","onUpdate:modelValue":e[39]||(e[39]=c=>s.n_predicts=c),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[Ue,s.n_predicts]]),u("span",ett,"Current value: "+ge(s.n_predicts),1)]),u("div",ttt,[ntt,ce(u("input",{type:"number","onUpdate:modelValue":e[40]||(e[40]=c=>s.seed=c),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[Ue,s.seed]]),u("span",itt,"Current value: "+ge(s.seed),1)])]),_:1})]),_:1})])]),Ie(d,{ref:"toast"},null,512)],64)}const rtt=bt(CJe,[["render",stt]]);const ott={data(){return{activeExtension:null}},computed:{activeExtensions(){return console.log(this.$store.state.extensionsZoo),console.log(nM(this.$store.state.extensionsZoo)),this.$store.state.extensionsZoo}},methods:{showExtensionPage(n){this.activeExtension=n}}},att={class:"container overflow-y-scroll flex flex-col shadow-lg p-10 pt-0 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"},ltt={key:0},ctt=["onClick"],dtt={key:0},utt=["src"],ptt={key:1},_tt=u("p",null,"No extension is active. Please install and activate an extension.",-1),htt=[_tt];function ftt(n,e,t,i,s,r){return N(),M("div",att,[r.activeExtensions.length>0?(N(),M("div",ltt,[(N(!0),M($e,null,dt(r.activeExtensions,o=>(N(),M("div",{key:o.name,onClick:a=>r.showExtensionPage(o)},[u("div",{class:Ye({"active-tab":o===s.activeExtension})},ge(o.name),3)],8,ctt))),128)),s.activeExtension?(N(),M("div",dtt,[u("iframe",{src:s.activeExtension.page,width:"100%",height:"500px",frameborder:"0"},null,8,utt)])):W("",!0)])):(N(),M("div",ptt,htt))])}const mtt=bt(ott,[["render",ftt]]);var hO={exports:{}};/* @license + `,36),[[Ue,s.text]]),u("span",null,"Cursor position "+ge(s.cursorPosition),1)])):W("",!0),s.audio_url!=null?(N(),M("audio",{controls:"",autoplay:"",key:s.audio_url},[u("source",{src:s.audio_url,type:"audio/wav",ref:"audio_player"},null,8,get),Ze(" Your browser does not support the audio element. ")])):W("",!0),Ie(o,{namedTokens:s.namedTokens},null,8,["namedTokens"]),s.tab_id==="render"?(N(),M("div",bet,[Ie(a,{ref:"mdRender","markdown-text":s.text,class:"mt-4 p-2 rounded shadow-lg dark:bg-bg-dark"},null,8,["markdown-text"])])):W("",!0)],2)]),Ie(l,{title:"settings",class:"slider-container ml-0 mr-0 max-width",isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:nt(()=>[Ie(l,{title:"Model",class:"slider-container ml-0 mr-0",is_subcard:!0,isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:nt(()=>[ce(u("select",{"onUpdate:modelValue":e[26]||(e[26]=c=>this.$store.state.selectedModel=c),onChange:e[27]||(e[27]=(...c)=>r.setModel&&r.setModel(...c)),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},[(N(!0),M($e,null,dt(r.models,c=>(N(),M("option",{key:c,value:c},ge(c),9,Eet))),128))],544),[[zn,this.$store.state.selectedModel]]),s.selecting_model?(N(),M("div",vet,Tet)):W("",!0)]),_:1}),Ie(l,{title:"Presets",class:"slider-container ml-0 mr-0",is_subcard:!0,isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:nt(()=>[ce(u("select",{"onUpdate:modelValue":e[28]||(e[28]=c=>s.selectedPreset=c),class:"bg-white dark:bg-black mb-2 border-2 rounded-md shadow-sm w-full"},[(N(!0),M($e,null,dt(s.presets,c=>(N(),M("option",{key:c,value:c},ge(c.name),9,xet))),128))],512),[[zn,s.selectedPreset]]),Cet,u("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[29]||(e[29]=(...c)=>r.setPreset&&r.setPreset(...c)),title:"Use preset"},Aet),u("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[30]||(e[30]=(...c)=>r.addPreset&&r.addPreset(...c)),title:"Add this text as a preset"},Net),u("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[31]||(e[31]=(...c)=>r.removePreset&&r.removePreset(...c)),title:"Remove preset"},Iet),u("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[32]||(e[32]=(...c)=>r.reloadPresets&&r.reloadPresets(...c)),title:"Reload presets list"},Det)]),_:1}),Ie(l,{title:"Generation params",class:"slider-container ml-0 mr-0",is_subcard:!0,isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:nt(()=>[u("div",ket,[Let,ce(u("input",{type:"range","onUpdate:modelValue":e[33]||(e[33]=c=>s.temperature=c),min:"0",max:"5",step:"0.1",class:"w-full"},null,512),[[Ue,s.temperature]]),u("span",Pet,"Current value: "+ge(s.temperature),1)]),u("div",Uet,[Fet,ce(u("input",{type:"range","onUpdate:modelValue":e[34]||(e[34]=c=>s.top_k=c),min:"1",max:"100",step:"1",class:"w-full"},null,512),[[Ue,s.top_k]]),u("span",Bet,"Current value: "+ge(s.top_k),1)]),u("div",Get,[zet,ce(u("input",{type:"range","onUpdate:modelValue":e[35]||(e[35]=c=>s.top_p=c),min:"0",max:"1",step:"0.1",class:"w-full"},null,512),[[Ue,s.top_p]]),u("span",Vet,"Current value: "+ge(s.top_p),1)]),u("div",Het,[qet,ce(u("input",{type:"range","onUpdate:modelValue":e[36]||(e[36]=c=>s.repeat_penalty=c),min:"0",max:"5",step:"0.1",class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[Ue,s.repeat_penalty]]),u("span",Yet,"Current value: "+ge(s.repeat_penalty),1)]),u("div",$et,[Wet,ce(u("input",{type:"range","onUpdate:modelValue":e[37]||(e[37]=c=>s.repeat_last_n=c),min:"0",max:"100",step:"1",class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[Ue,s.repeat_last_n]]),u("span",Ket,"Current value: "+ge(s.repeat_last_n),1)]),u("div",jet,[Qet,ce(u("input",{type:"number","onUpdate:modelValue":e[38]||(e[38]=c=>s.n_crop=c),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[Ue,s.n_crop]]),u("span",Xet,"Current value: "+ge(s.n_crop),1)]),u("div",Zet,[Jet,ce(u("input",{type:"number","onUpdate:modelValue":e[39]||(e[39]=c=>s.n_predicts=c),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[Ue,s.n_predicts]]),u("span",ett,"Current value: "+ge(s.n_predicts),1)]),u("div",ttt,[ntt,ce(u("input",{type:"number","onUpdate:modelValue":e[40]||(e[40]=c=>s.seed=c),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[Ue,s.seed]]),u("span",itt,"Current value: "+ge(s.seed),1)])]),_:1})]),_:1})])]),Ie(d,{ref:"toast"},null,512)],64)}const rtt=bt(CJe,[["render",stt]]);const ott={data(){return{activeExtension:null}},computed:{activeExtensions(){return console.log(this.$store.state.extensionsZoo),console.log(nM(this.$store.state.extensionsZoo)),this.$store.state.extensionsZoo}},methods:{showExtensionPage(n){this.activeExtension=n}}},att={class:"container overflow-y-scroll flex flex-col shadow-lg p-10 pt-0 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"},ltt={key:0},ctt=["onClick"],dtt={key:0},utt=["src"],ptt={key:1},_tt=u("p",null,"No extension is active. Please install and activate an extension.",-1),htt=[_tt];function ftt(n,e,t,i,s,r){return N(),M("div",att,[r.activeExtensions.length>0?(N(),M("div",ltt,[(N(!0),M($e,null,dt(r.activeExtensions,o=>(N(),M("div",{key:o.name,onClick:a=>r.showExtensionPage(o)},[u("div",{class:Ye({"active-tab":o===s.activeExtension})},ge(o.name),3)],8,ctt))),128)),s.activeExtension?(N(),M("div",dtt,[u("iframe",{src:s.activeExtension.page,width:"100%",height:"500px",frameborder:"0"},null,8,utt)])):W("",!0)])):(N(),M("div",ptt,htt))])}const mtt=bt(ott,[["render",ftt]]);var hO={exports:{}};/* @license Papa Parse v5.4.1 https://github.com/mholt/PapaParse diff --git a/web/dist/index.html b/web/dist/index.html index 09050330..9a653886 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -6,7 +6,7 @@ LoLLMS WebUI - Welcome - + diff --git a/web/src/views/PlayGroundView.vue b/web/src/views/PlayGroundView.vue index 96e41ac2..76b0b8ec 100644 --- a/web/src/views/PlayGroundView.vue +++ b/web/src/views/PlayGroundView.vue @@ -148,7 +148,7 @@ -