File size: 1,104 Bytes
42bea7a
 
 
 
 
 
 
5913d56
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
---
library_name: transformers
pipeline_tag: text-generation
base_model:
- meta-llama/Meta-Llama-3.1-8B
---




This repository fixes the original broken-model so it works correctly with OpenAI-style chat APIs such as /chat/completions.

The problem was that the original tokenizer configuration did not define a chat template. When a model is served with Text Generation Inference, chat requests are sent as structured messages with roles like user and assistant. Without a chat template, the server does not know how to convert those messages into the text format expected by the model, which causes chat requests to fail.

To fix this, tokenizer_config.json was updated. The bos_token was set to <|endoftext|> instead of null, and a chat_template was added. The chat template formats each message using <|im_start|> and <|im_end|> tokens and includes the role and content of each message. This matches the expected Qwen-style prompt format.

With these changes, the server can correctly serialize chat messages into a prompt and the model can generate responses normally when using /chat/completions.