Skip to content

Model outputs � in Korean/Chinese #284

Closed
@bqhuyy

Description

@bqhuyy

Issue description

Model outputs � in Korean/Chinese

Expected Behavior

Model can output correct Unicode/UTF8 character

Actual Behavior

Model outputs �

Steps to reproduce

This problem occurs when working with Chinese/Korean. I'm using Llama 3.1 - Q4_K_M. It also occurs with Qwen2 models.

const a1 = await session.prompt(q1, {
    onTextChunk(chunk) {
        process.stdout.write(chunk); // `chunk` returns �
    }
});

My Environment

Dependency Version
Operating System Windows 10
CPU AMD Ryzen 7 3700X
Node.js version v20.11.1
Typescript version 5.5.2
node-llama-cpp version 3.0.0-beta.40

Additional Context

I've tried to use onToken/onTextChunk function. It still returns same result. I see some related issues: ggml-org/llama.cpp#11 , ggml-org/llama.cpp#79

Relevant Features Used

  • Metal support
  • CUDA support
  • Grammar

Are you willing to resolve this issue by submitting a Pull Request?

Yes, I have the time, but I don't know how to start. I would need guidance.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions