server : handle bytes

This commit is contained in:
Jhen 2023-08-02 16:14:10 +08:00
parent d37be8dc9e
commit 7f02fead8c

View file

@ -424,17 +424,21 @@
const popoverChildren = html` const popoverChildren = html`
<div> <div>
${completion_probabilities.map((cp, i) => { ${completion_probabilities.map((cp, i) => {
return cp.probs.map((p, j) => {
return html` return html`
<div style=${{ <div key={i} style=${{ borderBottom: '1px solid #ccc', padding: '0.3em' }}>
${cp.probs.map((p, j) => {
return html`
<div key=${`${i}-${j}`} style=${{
padding: '0.3em', padding: '0.3em',
backgroundColor: p.tok_str === msg.content ? probColor(p.prob) : 'transparent' backgroundColor: p.tok_str === cp.content ? probColor(p.prob) : 'transparent'
}}> }}>
<span>${p.tok_str}: </span> <span>${p.tok_str}: </span>
<span>${p.prob}</span> <span>${p.prob}</span>
</div> </div>
` `
}) })}
</div>
`
})} })}
</div> </div>
` `