This commit is contained in:
Henri Vasserman 2023-07-24 14:09:05 +03:00
parent f77972f9af
commit ca2467d12c
No known key found for this signature in database
GPG Key ID: 2995FC0F58B1A986
2 changed files with 1072 additions and 901 deletions

File diff suppressed because it is too large Load Diff

View File

@ -41,25 +41,31 @@
padding: 0.5em; padding: 0.5em;
} }
#chat {
display: flex;
flex-direction: column;
}
.bubble { .bubble {
border: 1px solid; border: 1px solid;
border-radius: 10px; border-radius: 1.0em;
padding: 5px; padding: 0.5em;
max-width: 75%;
margin-top: 0;
} }
.user { .user {
background-color: #161616; background-color: #161616;
color: #d6d6d6; color: #d6d6d6;
margin-left: 20%;
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
place-self: flex-end;
} }
.asst { .asst {
background-color: #d6d6d6; background-color: #d6d6d6;
color: #161616; color: #161616;
text-align: left; border-bottom-left-radius: 0;
margin-right: 20%; place-self: flex-start;
border-top-left-radius: 0;
} }
.typing { .typing {
@ -143,7 +149,6 @@
stop: ["###"], stop: ["###"],
transcript: [], transcript: [],
type: "chat", type: "chat",
fullprompt: "", // debug
}) })
const params = signal({ const params = signal({
@ -160,7 +165,7 @@
mirostat: 0, mirostat: 0,
mirostat_tau: 5.0, mirostat_tau: 5.0,
mirostat_eta: 0.1, mirostat_eta: 0.1,
cfg_scale: 1.0, cfg_scale: 4.0,
penalize_nl: true, penalize_nl: true,
}) })
@ -204,7 +209,6 @@
const cfg_negative_prompt = params.value.cfg_scale > 1 ? session.value.transcript.map(t => const cfg_negative_prompt = params.value.cfg_scale > 1 ? session.value.transcript.map(t =>
template(session.value.message, { ...t, system: session.value.system_cfg }) template(session.value.message, { ...t, system: session.value.system_cfg })
).join("").trimEnd() : "" ).join("").trimEnd() : ""
session.value = { ...session.value, fullprompt: cfg_negative_prompt } // debug
let currentMessage = '' let currentMessage = ''
@ -273,7 +277,6 @@
<button onclick=${stop} disabled=${generating}>Stop</button> <button onclick=${stop} disabled=${generating}>Stop</button>
<button onclick=${reset}>Reset</button> <button onclick=${reset}>Reset</button>
</div> </div>
<pre>${session.value.fullprompt/* debug */}</pre>
</form> </form>
` `
} }
@ -299,7 +302,7 @@
html`<p class="typing">...</p>`} html`<p class="typing">...</p>`}
`)} `)}
</section> </section>
<pre>${JSON.stringify(session.value.transcript, null, 2)}</pre>` // debug `
} }
const ParamSlider = ({param, min, max, step, children}) => { const ParamSlider = ({param, min, max, step, children}) => {
@ -344,8 +347,6 @@
<p><input type="text" name="stop.${i}" value="${stop}" oninput=${updateArray}/></p> <p><input type="text" name="stop.${i}" value="${stop}" oninput=${updateArray}/></p>
`)} `)}
<input type="button" value="+" onclick=${appendArray} /> <input type="button" value="+" onclick=${appendArray} />
<pre>${JSON.stringify(session.value.stop)/* debug */}</pre>
</div> </div>
<${ParamSlider} min=1 max=10 step=0.1 param=cfg_scale>CFG scale<//> <${ParamSlider} min=1 max=10 step=0.1 param=cfg_scale>CFG scale<//>
@ -387,7 +388,6 @@
<${ParamSlider} min=0 max=1000 step=1 param=mirostat_tau>Mirostat tau, target entropy<//> <${ParamSlider} min=0 max=1000 step=1 param=mirostat_tau>Mirostat tau, target entropy<//>
`} `}
`} `}
<pre>${JSON.stringify(params.value, null, 2)/*debug*/}</pre>
</fieldset> </fieldset>
</form> </form>
` `