From 3409735cff49e461961e89fb6ca9ca1ff2200986 Mon Sep 17 00:00:00 2001 From: jhen Date: Sat, 12 Aug 2023 12:06:40 +0800 Subject: [PATCH] server : skip byte pair in display probabilites --- examples/server/public/index.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/server/public/index.html b/examples/server/public/index.html index 007e1bb3a..5495bb73a 100644 --- a/examples/server/public/index.html +++ b/examples/server/public/index.html @@ -441,12 +441,12 @@ return params.data.map(msg => { const { completion_probabilities } = msg; - let pColor = 'transparent'; - if (completion_probabilities.length === 1) { - const { probs } = completion_probabilities[0] - const found = probs.find(p => p.tok_str === msg.content) - pColor = probColor(found ? found.prob : 0) - } + // Skip byte pair + if (completion_probabilities.length > 1) return msg.content + + const { probs } = completion_probabilities[0] + const found = probs.find(p => p.tok_str === msg.content) + const pColor = probColor(found ? found.prob : 0) const popoverChildren = html`