You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
报错信息为:
maxlen 40
Traceback (most recent call last):
File "/usr/local/bin/llamafactory-cli", line 8, in
sys.exit(main())
File "/app/src/llamafactory/cli.py", line 87, in main
export_model()
File "/app/src/llamafactory/train/tuner.py", line 109, in export_model
model = load_model(tokenizer, model_args, finetuning_args) # must after fixing tokenizer to resize vocab
File "/app/src/llamafactory/model/loader.py", line 132, in load_model
patch_config(config, tokenizer, model_args, init_kwargs, is_trainable)
File "/app/src/llamafactory/model/patcher.py", line 111, in patch_config
configure_quantization(config, tokenizer, model_args, init_kwargs)
File "/app/src/llamafactory/model/model_utils/quantization.py", line 150, in configure_quantization
dataset=_get_quantization_dataset(tokenizer, model_args),
File "/app/src/llamafactory/model/model_utils/quantization.py", line 88, in _get_quantization_dataset
sample: Dict[str, "torch.Tensor"] = tokenizer(dataset[sample_idx]["text"], return_tensors="pt")
KeyError: 'text'
bugSomething isn't workingpendingThis problem is yet to be addressed
1 participant
Converted from issue
This discussion was converted from issue #8735 on July 24, 2025 14:41.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Reminder
System Info
INFO 07-24 10:17:15 init.py:194] No platform detected, vLLM is running on UnspecifiedPlatform
llamafactoryversion: 0.9.2.dev0Reproduction
执行的命令是:
CUDA_VISIBLE_DEVICES=1 llamafactory-cli export --model_name_or_path "/data3/models/test/export/lora" --template "glm4" --export_quantization_dataset "./data/微调数据集1勿动.json" --export_dir "/data3/models/test/export1" --export_size 2 --trust-remote-code true --export_device cpu --export_legacy_format False --export_quantization_bit 4 --export_quantization_maxlen 40
报错信息为:
maxlen 40
Traceback (most recent call last):
File "/usr/local/bin/llamafactory-cli", line 8, in
sys.exit(main())
File "/app/src/llamafactory/cli.py", line 87, in main
export_model()
File "/app/src/llamafactory/train/tuner.py", line 109, in export_model
model = load_model(tokenizer, model_args, finetuning_args) # must after fixing tokenizer to resize vocab
File "/app/src/llamafactory/model/loader.py", line 132, in load_model
patch_config(config, tokenizer, model_args, init_kwargs, is_trainable)
File "/app/src/llamafactory/model/patcher.py", line 111, in patch_config
configure_quantization(config, tokenizer, model_args, init_kwargs)
File "/app/src/llamafactory/model/model_utils/quantization.py", line 150, in configure_quantization
dataset=_get_quantization_dataset(tokenizer, model_args),
File "/app/src/llamafactory/model/model_utils/quantization.py", line 88, in _get_quantization_dataset
sample: Dict[str, "torch.Tensor"] = tokenizer(dataset[sample_idx]["text"], return_tensors="pt")
KeyError: 'text'
我现在有个疑问export_quantization_dataset 这个参数指定的是什么,我已经使用“微调数据集1勿动.json”这个微调数据对模型进行微调,但是在导出时报以上错误,我的“量化校准数据集.json”是以下截图:
我现在不清楚export_quantization_dataset需要指定我训练时的“微调数据集1勿动.json”这个数据集还是指定“量化校准数据集.json”这个文件。
希望得到您的回答,谢谢
Others
No response
Beta Was this translation helpful? Give feedback.
All reactions