Repository navigation
Description
Hello,
I'm having problem to run a GGUF model trained with unsloth in RunPod.
`mkdir finetuning
cd finetuning
python -m venv venv
source venv/bin/activate
pip install unsloth
cd llama.cpp
git checkout b3345
git submodule update --init --recursive
make clean
make all -j
git log -1
cd ..
python train.py`
This is what i run and train.py is the same version of Llama3.2_(1B_and_3B)
`main: build = 3345 (2ee44c9a)
main: built with cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 for x86_64-linux-gnu
main: seed = 1741385703
llama_model_loader: loaded meta data with 23 key-value pairs and 254 tensors from ../model/unsloth.Q8_0.gguf (version GGUF V3 (latest))
llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output.
llama_model_loader: - kv 0: general.architecture str = llama
llama_model_loader: - kv 1: general.name str = model
llama_model_loader: - kv 2: llama.block_count u32 = 28
llama_model_loader: - kv 3: llama.context_length u32 = 131072
llama_model_loader: - kv 4: llama.embedding_length u32 = 3072
llama_model_loader: - kv 5: llama.feed_forward_length u32 = 8192
llama_model_loader: - kv 6: llama.attention.head_count u32 = 24
llama_model_loader: - kv 7: llama.attention.head_count_kv u32 = 8
llama_model_loader: - kv 8: llama.rope.freq_base f32 = 500000.000000
llama_model_loader: - kv 9: llama.attention.layer_norm_rms_epsilon f32 = 0.000010
llama_model_loader: - kv 10: general.file_type u32 = 7
llama_model_loader: - kv 11: llama.vocab_size u32 = 128256
llama_model_loader: - kv 12: llama.rope.dimension_count u32 = 128
llama_model_loader: - kv 13: tokenizer.ggml.model str = gpt2
llama_model_loader: - kv 14: tokenizer.ggml.pre str = llama-bpe
llama_model_loader: - kv 15: tokenizer.ggml.tokens arr[str,128256] = ["!", """, "#", "$", "%", "&", "'", ...
llama_model_loader: - kv 16: tokenizer.ggml.token_type arr[i32,128256] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
llama_model_loader: - kv 17: tokenizer.ggml.bos_token_id u32 = 128000
llama_model_loader: - kv 18: tokenizer.ggml.eos_token_id u32 = 128009
llama_model_loader: - kv 19: tokenizer.ggml.padding_token_id u32 = 128004
llama_model_loader: - kv 20: tokenizer.ggml.add_bos_token bool = true
llama_model_loader: - kv 21: tokenizer.chat_template str = {{- bos_token }}\n{%- if custom_tools ...
llama_model_loader: - kv 22: general.quantization_version u32 = 2
llama_model_loader: - type f32: 57 tensors
llama_model_loader: - type q8_0: 197 tensors
llama_model_load: error loading model: error loading model vocabulary: cannot find tokenizer merges in model file
llama_load_model_from_file: failed to load model
llama_init_from_gpt_params: error: failed to load model '../model/unsloth.Q8_0.gguf'
main: error: unable to load model`
I have try different solutions without any luck:
Some of them:
#1928 (comment)
#1062 (comment)
#1925 (comment)
#1065 (comment)
But all this has not worked.
I have tried with the latest version of unsloth and with version 2024.12.4 and i'm trying to train unsloth/Llama-3.2-3B-Instruct model,
Maybe there is some mistake in my configuration or someone else has the same problem in Runpod?
Activity
[-][Run Pod] - llama_model_load: error loading model: error loading model vocabulary: cannot find tokenizer merges in model file[/-][+][RunPod] - llama_model_load: error loading model: error loading model vocabulary: cannot find tokenizer merges in model file[/+]lastrei commentedon Mar 8, 2025
same issus
lastrei commentedon Mar 8, 2025
basemodel:unsloth/DeepSeek-R1-Distill-Llama-8B-unsloth-bnb-4bit
llama.cpp like below:
the model can success generate with FastLanguageModel.for_inference(model)
also can merge to gguf
but when i success make ollama file and run
like #1065
This problem occurred a few months ago, but the previous solution does not work. After successfully creating the model, the error still occurs when running Ollama.
lastrei commentedon Mar 12, 2025
solve,use the latest llama.cpp and use cmake build with cuda
copy the llama-quantize under the build to llama.cpp Root Directory and re run save gguf.
nancyxiaojing commentedon Apr 24, 2025
I got same issue, Could you please share the detailed step of “use cmake build with cuda”? thanks!
nancyxiaojing commentedon Apr 24, 2025
@lastrei
nancyxiaojing commentedon Apr 24, 2025
Got answer from Deepseek, it works:
具体步骤
1. 安装依赖环境
确保系统中已安装以下依赖:
CUDA Toolkit(版本 >= 11.0,需与显卡驱动兼容)
CMake(版本 >= 3.13)
Git(用于克隆代码)
bash
在 Ubuntu/Debian 系统中安装依赖
sudo apt update
sudo apt install -y cmake git build-essential
2. 克隆最新版 llama.cpp
bash
git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
git pull # 确保代码是最新版
3. 使用 CMake 构建带 CUDA 支持的代码
bash
mkdir build && cd build # 创建构建目录
cmake .. -DLLAMA_CUBLAS=ON # 启用 CUDA 加速(关键参数)
cmake --build . --config Release # 编译生成二进制文件
关键参数解释:
-DLLAMA_CUBLAS=ON:启用 CUDA 的 CUBLAS 库支持,加速矩阵运算。
如果 CUDA 路径未被自动识别,需手动指定路径(例如 -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-12.2)。
4. 复制关键工具到根目录
编译完成后,生成的二进制文件(如 llama-quantize)默认在 build/bin 目录下。
需要将其复制到项目根目录,以便后续命令能直接调用:
bash
cp ./build/bin/llama-quantize ../ # 复制到 llama.cpp 根目录
danielhanchen commentedon Jul 14, 2026
This should be fixed now - sorry on the delay - please update with
uv pip install --upgrade unsloth unsloth_zoo --force-reinstall --no-cache-dir- if it's not fixed yet, it'll be in the next pip / PyPI release - if it's still not working after that, please open another issue - appreciate it again!The llama.cpp pipeline now uses a modern converter that writes BPE merges, so the RunPod GGUF load error is gone.
XPU: train an explicit bf16 load in bf16 under the fp16 idiom, and ma…