Skip to content

Commit 063ba92

Browse files
authored
Improved the tokenizer playground (huggingface#46)
- Added target to playground link - Changed colors of the token ids to make them more readable on a white background
1 parent 9081e83 commit 063ba92

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

the-tokenizer-playground/src/App.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,9 @@ function App() {
104104
<h2 className="text-lg font-normal">
105105
Experiment with different tokenizers (running{" "}
106106
<a
107-
className="text-gray-900 underline"
107+
className="text-blue-500 underline"
108108
href="https://github.com/huggingface/transformers.js"
109+
target="_blank"
109110
>
110111
locally
111112
</a>{" "}
@@ -173,7 +174,7 @@ function App() {
173174

174175
<div
175176
ref={outputRef}
176-
className="font-mono text-lg p-2.5 w-full bg-gray-100 rounded-lg border border-gray-200 whitespace-pre-wrap text-left h-[200px] overflow-y-auto"
177+
className={`font-mono text-lg p-2.5 w-full bg-gray-100 rounded-lg border border-gray-200 whitespace-pre-wrap text-left h-[200px] overflow-y-auto text-gray-600`}
177178
>
178179
{outputOption === "text"
179180
? decodedTokens.map((token, index) => (

the-tokenizer-playground/src/components/Token.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function Token({ text, position, margin }) {
1818
return (
1919
<span
2020
style={{ marginLeft: margin }}
21-
className={`leading-5 ${textWithLineBreaks.length === 1 ? "inline-block " : ""}${COLOURS[position % COLOURS.length]}`}
21+
className={`leading-5 text-white/[0.87] ${textWithLineBreaks.length === 1 ? "inline-block " : ""}${COLOURS[position % COLOURS.length]}`}
2222
>
2323
{textWithLineBreaks}
2424
</span>

0 commit comments

Comments
 (0)