Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved the tokenizer playground #46

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions the-tokenizer-playground/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ function App() {
<h2 className="text-lg font-normal">
Experiment with different tokenizers (running{" "}
<a
className="text-gray-900 underline"
className="text-blue-500 underline"
href="https://github.com/huggingface/transformers.js"
target="_blank"
>
locally
</a>{" "}
Expand Down Expand Up @@ -173,7 +174,7 @@ function App() {

<div
ref={outputRef}
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"
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`}
>
{outputOption === "text"
? decodedTokens.map((token, index) => (
Expand Down
2 changes: 1 addition & 1 deletion the-tokenizer-playground/src/components/Token.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function Token({ text, position, margin }) {
return (
<span
style={{ marginLeft: margin }}
className={`leading-5 ${textWithLineBreaks.length === 1 ? "inline-block " : ""}${COLOURS[position % COLOURS.length]}`}
className={`leading-5 text-white/[0.87] ${textWithLineBreaks.length === 1 ? "inline-block " : ""}${COLOURS[position % COLOURS.length]}`}
>
{textWithLineBreaks}
</span>
Expand Down