Skip to content

qwen2.5-7b-Instruct进行lora微调合并后推理报错 #3710

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jerry1993-tech opened this issue Mar 28, 2025 · 2 comments
Closed

qwen2.5-7b-Instruct进行lora微调合并后推理报错 #3710

jerry1993-tech opened this issue Mar 28, 2025 · 2 comments

Comments

@jerry1993-tech
Copy link

Describe the bug
What the bug is, and how to reproduce, better with screenshots(描述bug以及复现过程,最好有截图)

Your hardware and system info
ms-opencompass 0.1.6
ms_swift 3.2.2
ms-vlmeval 0.0.14
msgpack 1.1.0
msgspec 0.19.0
multidict 6.0.4
multiprocess 0.70.16
narwhals 1.32.0
nbclassic 0.2.8
nbclient 0.8.0
nbconvert 7.7.3
nbformat 5.9.2
nest-asyncio 1.5.7
networkx 3.0
ninja 1.11.1.4
nltk 3.9.1
notebook 6.4.12
numba 0.60.0
numpy 1.26.4
nvidia-cublas-cu12 12.4.5.8
nvidia-cuda-cupti-cu12 12.4.127
nvidia-cuda-nvrtc-cu12 12.4.127
nvidia-cuda-runtime-cu12 12.4.127
nvidia-cudnn-cu12 9.1.0.70
nvidia-cufft-cu12 11.2.1.3
nvidia-curand-cu12 10.3.5.147
nvidia-cusolver-cu12 11.6.1.9
nvidia-cusparse-cu12 12.3.1.170
nvidia-ml-py 12.570.86
nvidia-nccl-cu12 2.21.5
nvidia-nvjitlink-cu12 12.4.127
nvidia-nvtx-cu12 12.4.127
nvitop 1.4.2
oauthlib 3.2.2
omegaconf 2.0.6
openai 1.69.0
OpenCC 1.1.9
opencv-python 4.8.1.78
opencv-python-headless 4.11.0.86
openpyxl 3.1.5
opt-einsum 3.3.0
orjson 3.10.16
oss2 2.18.1
outlines 0.1.11
outlines_core 0.1.26
packaging 23.0
pandas 2.1.2
pandocfilters 1.5.0
parso 0.8.3
partial-json-parser 0.2.1.1.post5
peft 0.15.1
pexpect 4.8.0
phx-class-registry 4.1.0
pickleshare 0.7.5
pillow 11.1.0
pip 23.1.2
platformdirs 3.10.0
plotly 6.0.1
pluggy 1.5.0
ply 3.11
portalocker 3.1.1
prettytable 3.16.0
prometheus_client 0.21.1
prometheus-fastapi-instrumentator 7.1.0
prompt-toolkit 3.0.39
protobuf 4.23.4
psutil 5.9.5
ptyprocess 0.7.0
pure-eval 0.2.2
py-cpuinfo 9.0.0
pyarrow 19.0.1
pyasn1 0.5.0
pyasn1-modules 0.3.0
pybind11 2.13.6
pycosat 0.6.4
pycountry 24.6.1
pycparser 2.21
pycryptodome 3.18.0
pydantic 2.11.0
pydantic_core 2.33.0
pydeck 0.9.1
pydub 0.25.1
Pygments 2.15.1
Pympler 1.1
pynvml 12.0.0
pyOpenSSL 23.0.0
pyparsing 3.1.1
pypinyin 0.53.0
PySocks 1.7.1
pytest 8.3.5
python-dateutil 2.8.2
python-dotenv 1.0.0
python-Levenshtein 0.27.1
python-multipart 0.0.20
pytz 2023.3.post1
PyYAML 6.0.1
pyzmq 25.1.0
rank-bm25 0.2.2
RapidFuzz 3.12.2
ray 2.40.0
referencing 0.30.0
regex 2024.11.6
requests 2.32.3
requests-oauthlib 1.3.1
requests-toolbelt 1.0.0
rich 13.9.4
rich-toolkit 0.14.0
rouge 1.0.1
rouge-chinese 1.0.3
rouge-score 0.1.2
rpds-py 0.9.2
rsa 4.9
ruamel.yaml 0.17.21
ruamel.yaml.clib 0.2.6
ruff 0.11.2
s3transfer 0.11.4
sacrebleu 2.5.1
safehttpx 0.1.6
safetensors 0.5.3
scikit-image 0.22.0
scikit-learn 1.3.2
scipy 1.11.3
seaborn 0.13.0
semantic-version 2.10.0
Send2Trash 1.8.2
sentence-transformers 4.0.1
sentencepiece 0.2.0
setuptools 69.5.1
sgmllib3k 1.0.0
shellingham 1.5.4
simple-ddl-parser 1.7.1
simple-uploader 0.0.15
simplejson 3.20.1
six 1.16.0
smmap 5.0.2
sniffio 1.3.0
socksio 1.0.0
sortedcontainers 2.4.0
soupsieve 2.4.1
sshpubkeys 3.3.1
stack-data 0.6.2
starlette 0.46.1
streamlit 1.44.0
sty 1.0.6
swankit 0.1.6
swanlab 0.5.3
sympy 1.13.1
tabulate 0.9.0
tenacity 9.0.0
tensorboard 2.13.0
tensorboard-data-server 0.7.1
tensorflow 2.13.0
tensorflow-estimator 2.13.0
tensorflow-io-gcs-filesystem 0.33.0
termcolor 2.3.0
terminado 0.17.1
threadpoolctl 3.2.0
tifffile 2023.9.26
tiktoken 0.9.0
timeout-decorator 0.5.0
tinycss2 1.2.1
tokenizers 0.21.1
toml 0.10.2
tomli 2.2.1
tomlkit 0.13.2
toolz 0.12.0
torch 2.5.1
torchaudio 2.5.1
torchvision 0.20.1
tornado 6.3.2
tqdm 4.67.1
traitlets 5.9.0
transformers 4.50.2
transformers-stream-generator 0.0.5
triton 3.1.0
trl 0.16.0
typer 0.15.2
typing_extensions 4.13.0
typing-inspection 0.4.0
tzdata 2023.3
urllib3 1.26.20
uvicorn 0.23.2
uvloop 0.19.0
validators 0.34.0
vllm 0.7.3
watchdog 6.0.0
watchfiles 0.21.0
wcwidth 0.2.5
webencodings 0.5.1
websocket-client 1.2.1
websockets 12.0
Werkzeug 2.3.6
wheel 0.38.4
widgetsnbextension 4.0.13
word2number 1.1
workspace 0.1.0
wrapt 1.15.0
xformers 0.0.28.post3
xgrammar 0.1.11
XlsxWriter 3.2.2
xtuner 0.1.23
xxhash 3.5.0
yapf 0.43.0
yarl 1.9.2
zipp 3.21.0
zstandard 0.19.0

Additional context
Add any other context about the problem here(在这里补充其他信息)

Image

Image

@jerry1993-tech
Copy link
Author

我的推理代码1:
python‘’‘

from transformers import AutoModelForCausalLM, AutoTokenizer

model_path = "/home/featurize/work/model/checkpoint-100-merged" # 替换为实际路径或模型名称
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(
model_path,
torch_dtype="auto",
device_map="auto"
)

prompt = "你好,请介绍Qwen2.5-7B-Instruct的特点"
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": prompt}
]

text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
inputs = tokenizer(text, return_tensors="pt").to(model.device)

outputs = model.generate(
**inputs,
max_new_tokens=512
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

’‘’
推理脚本2:

from vllm import LLM, SamplingParams

llm = LLM(
model="/home/featurize/work/model/checkpoint-100-merged",
max_model_len=8_000,
tensor_parallel_size=1
)

sampling_params = SamplingParams(
temperature=0.6,
max_tokens=8_000
)

prompts = [
"""请你逐步思考推理,对下方银行的资产总额进行升序排序:
上海银行20230930   30591.14亿元
兰州银行20230930   4587.98亿元
北京银行20230930   36724.18亿元
南京银行20230930   22406.79亿元
厦门银行20230930   3786.48亿元
宁波银行20230930   26702.28亿元
成都银行20230930   10630.39亿元
杭州银行20230930   17901.45亿元"""
]

conversations = [
[{"role": "user", "content": x}] for x in prompts
]

outputs = llm.chat(conversations, sampling_params=sampling_params)

for output in outputs:
print(output.outputs[0].text)

运行结果都报上述的错误!!!

@Jintao-Huang
Copy link
Collaborator

模型权重没有保存全,检查是否磁盘满了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants