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

Expected closing statement token. OpenSquareBracket !== CloseStatement #1176

Open
1 of 5 tasks
cwoolum opened this issue Jan 30, 2025 · 1 comment
Open
1 of 5 tasks
Labels
bug Something isn't working

Comments

@cwoolum
Copy link

cwoolum commented Jan 30, 2025

System Info

"@huggingface/transformers": "^3.3.2",

Environment/Platform

  • Website/web-app
  • Browser extension
  • Server-side (e.g., Node.js, Deno, Bun)
  • Desktop app (e.g., Electron)
  • Other (e.g., VSCode extension)

Description

When trying to parse messages using AutoTokenizer.from_pretrained with the model deepseek-ai/DeepSeek-R1-Distill-Llama-8B, I receive the error

Failed to get test result: Error: Parser Error: Expected closing statement token. OpenSquareBracket !== CloseStatement.

Others were seeing similar errors in other DeepSeek models but I'm not sure if that affects this package

https://huggingface.co/mlx-community/deepseek-r1-distill-qwen-1.5b/discussions/1

Reproduction

  1. Load the tokenizer and try to generate a prompt
async function loadTokenizer() {
  const tokenizer = await AutoTokenizer.from_pretrained('deepseek-ai/DeepSeek-R1-Distill-Llama-8B');
  return tokenizer;
}

const tokenizer = await loadTokenizer();
const prompt = tokenizer.apply_chat_template([{ role: 'user', content: 'How are you today?' }], { tokenize: false, add_generation_prompt: true })

An error will be thrown when tokenizer.apply_chat_template is called.

@cwoolum cwoolum added the bug Something isn't working label Jan 30, 2025
@xenova
Copy link
Collaborator

xenova commented Jan 30, 2025

Hi! This will be fixed by huggingface/huggingface.js#1142.

New release coming soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants