got error with "Failed to load model"
[FLM] Configuring NPU Power Mode to performance (flm default)
[FLM] New version detected! (current v1.0.2, latest v1.0.4)
[FLM] Download link: https://github.com/ROCm/FastFlowLM/releases/latest/download/flm-setup.msi
[FLM] Using user-specified port: 8081
[FLM] Loading model: D:\models\flm\models\MiniCPM5-2B-NPU2
[ERROR] Failed to load model: [json.exception.type_error.302] type must be number, but is null
[Error] Failed to load default model: minicpm5:2b
[FLM] Starting server on port 8081...
[FLM] WebServer started on port 8081 with 10 I/O threads
[FLM] Press Ctrl+C to stop.
Same error here on Linux (Strix Halo, FLM v1.0.1/v1.0.2/v1.0.4) β it's the model's tokenizer_config.json, not your setup.
It declares bos_token/eos_token/pad_token as strings but ships no bos_token_id/eos_token_id/pad_token_id. FLM reads the ids from that file, not from config.json (which does carry 0/1/1). v1.0.1/v1.0.2 report it as the unhelpful type must be number, but is null; v1.0.4 says it outright: bos_token is set in tokenizer_config.json but bos_token_id is missing or not an integer.
Add these three keys to tokenizer_config.json and it loads:
"bos_token_id": 0,
"eos_token_id": [1, 130073],
"pad_token_id": 1
eos_token_id must be an array β FLM rejects a scalar with eos_token_id is missing or not an array. 130073 is <|im_end|>, which is what the shipped chat_template.jinja actually ends turns with. (Values come from the repo's own config.json: bos 0, eos 1, pad 1.)
Heads-up on what comes next: after that fix it loads cleanly for me, but every inference then returns runlist failed execution (ERT_CMD_STATE_TIMEOUT) on Linux β I've filed that separately. You're on Windows, so if it actually generates for you after this fix, please say so β that would pin the second problem to the Linux driver stack and would be genuinely useful to know.
Thanks for reporting this! @Platano78 is spot-on. FastFlowLM's C++ loader expects explicit integer IDs in tokenizer_config.json.
I have just pushed a fix directly to this repository adding:
"bos_token_id": 0,
"eos_token_id": [1, 130073],
"pad_token_id": 1
How to update your local setup:
- If you cloned the repository via git into your models directory:
cd ~/.config/flm/models/MiniCPM5-2B-NPU2 # (or D:\models\flm\models\MiniCPM5-2B-NPU2 on Windows) git pull - Or manually add the three keys above into your local
tokenizer_config.json(ensureeos_token_idis an array[1, 130073], where130073is<|im_end|>). - Re-run
flm serve minicpm5:2b.
The model card has also been updated with a Troubleshooting & FAQ section covering this.