Skip to content

Commit

Permalink
Change token probability when switching tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
lmg-anon committed Jun 3, 2024
1 parent abc77df commit eb303a4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mikupad.html
Original file line number Diff line number Diff line change
Expand Up @@ -4812,7 +4812,8 @@
...promptChunks.slice(0, i),
{
...promptChunks[i],
content: tok,
content: tok.tok_str,
prob: tok.prob
},
];
setPromptChunks(newPrompt);
Expand Down Expand Up @@ -4961,7 +4962,7 @@
${probs.map((prob, i) => {
const index = currentPromptChunk?.index;
const isCurrentToken = promptChunks[index]?.prob == prob.prob;
return html`<button key=${i} className=${isCurrentToken ? 'current' : ''} onClick=${() => switchCompletion(index, prob.tok_str)}>
return html`<button key=${i} className=${isCurrentToken ? 'current' : ''} onClick=${() => switchCompletion(index, prob)}>
<div className="tok">${replaceUnprintableBytes(prob.tok_str)}</div>
<div className="prob">${(prob.prob * 100).toFixed(2)}%</div>
</button>`;
Expand Down

0 comments on commit eb303a4

Please sign in to comment.