Closed 2437528020 closed 1 month ago
你是用哪个模型进行的微调
遇见同样的问题,使用仓库中的finetune.py
对glm-4-9b-chat
进行微调后,得到如下文件:
使用basic_demo/vllm_cli_demo.py
进行推理,将LORA_PATH
设置为此文件夹路径后得到同样的报错
目前发现是vllm
和transformers
版本问题
切换版本:vllm==0.6.1.post2
transformers==0.44.0
问题解决
System Info / 系統信息
CUDA Version: 12.2 Transformers:4.45.1 Python:3.10.12 操作系统:ubuntu vllm:0.6.2
Who can help? / 谁可以帮助到您?
No response
Information / 问题信息
Reproduction / 复现过程
1.使用提供的finetune.py在个人数据集上微调。 2.修改openai_api_server.py内代码行 MODEL_PATH = os.environ.get('MODEL_PATH', ‘THUDM/glm-4-9b-chat') 为 MODEL_PATH = os.environ.get('MODEL_PATH', ‘../finetune_demo/output/checkpoint-12000') #这是我的微调结果输出路径 3.运行openai_api_server.py 错误信息为: Traceback (most recent call last): File "/mnt/sda/hzy/chatglm4/GLM-4-main/basic_demo/glm_server.py", line 671, in
tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH, trust_remote_code=True)
File "/home/ubuntu/anaconda3/envs/glm4_hzy/lib/python3.10/site-packages/transformers/models/auto/tokenization_auto.py", line 864, in from_pretrained
config = AutoConfig.from_pretrained(
File "/home/ubuntu/anaconda3/envs/glm4_hzy/lib/python3.10/site-packages/transformers/models/auto/configuration_auto.py", line 1038, in from_pretrained
raise ValueError(
ValueError: Unrecognized model in ../finetune_demo/output/checkpoint-12000. Should have a
model_type
key in its config.json, or contain one of the following strings in its name: albert, align, altclip, audio-spectrogram-transformer, autoformer, bark, bart, beit, bert, bert-generation, big_bird, bigbird_pegasus, biogpt, bit, blenderbot, blenderbot-small, blip, blip-2, bloom, bridgetower, bros, camembert, canine, chameleon, chinese_clip, chinese_clip_vision_model, clap, clip, clip_text_model, clip_vision_model, clipseg, clvp, code_llama, codegen, cohere, conditional_detr, convbert, convnext, convnextv2, cpmant, ctrl, cvt, dac, data2vec-audio, data2vec-text, data2vec-vision, dbrx, deberta, deberta-v2, decision_transformer, deformable_detr, deit, depth_anything, deta, detr, dinat, dinov2, distilbert, donut-swin, dpr, dpt, efficientformer, efficientnet, electra, encodec, encoder-decoder, ernie, ernie_m, esm, falcon, falcon_mamba, fastspeech2_conformer, flaubert, flava, fnet, focalnet, fsmt, funnel, fuyu, gemma, gemma2, git, glpn, gpt-sw3, gpt2, gpt_bigcode, gpt_neo, gpt_neox, gpt_neox_japanese, gptj, gptsan-japanese, granite, granitemoe, graphormer, grounding-dino, groupvit, hiera, hubert, ibert, idefics, idefics2, imagegpt, informer, instructblip, instructblipvideo, jamba, jetmoe, jukebox, kosmos-2, layoutlm, layoutlmv2, layoutlmv3, led, levit, lilt, llama, llava, llava_next, llava_next_video, llava_onevision, longformer, longt5, luke, lxmert, m2m_100, mamba, mamba2, marian, markuplm, mask2former, maskformer, maskformer-swin, mbart, mctct, mega, megatron-bert, mgp-str, mimi, mistral, mixtral, mllama, mobilebert, mobilenet_v1, mobilenet_v2, mobilevit, mobilevitv2, mpnet, mpt, mra, mt5, musicgen, musicgen_melody, mvp, nat, nemotron, nezha, nllb-moe, nougat, nystromformer, olmo, olmoe, omdet-turbo, oneformer, open-llama, openai-gpt, opt, owlv2, owlvit, paligemma, patchtsmixer, patchtst, pegasus, pegasus_x, perceiver, persimmon, phi, phi3, pix2struct, pixtral, plbart, poolformer, pop2piano, prophetnet, pvt, pvt_v2, qdqbert, qwen2, qwen2_audio, qwen2_audio_encoder, qwen2_moe, qwen2_vl, rag, realm, recurrent_gemma, reformer, regnet, rembert, resnet, retribert, roberta, roberta-prelayernorm, roc_bert, roformer, rt_detr, rt_detr_resnet, rwkv, sam, seamless_m4t, seamless_m4t_v2, segformer, seggpt, sew, sew-d, siglip, siglip_vision_model, speech-encoder-decoder, speech_to_text, speech_to_text_2, speecht5, splinter, squeezebert, stablelm, starcoder2, superpoint, swiftformer, swin, swin2sr, swinv2, switch_transformers, t5, table-transformer, tapas, time_series_transformer, timesformer, timm_backbone, trajectory_transformer, transfo-xl, trocr, tvlt, tvp, udop, umt5, unispeech, unispeech-sat, univnet, upernet, van, video_llava, videomae, vilt, vipllava, vision-encoder-decoder, vision-text-dual-encoder, visual_bert, vit, vit_hybrid, vit_mae, vit_msn, vitdet, vitmatte, vits, vivit, wav2vec2, wav2vec2-bert, wav2vec2-conformer, wavlm, whisper, xclip, xglm, xlm, xlm-prophetnet, xlm-roberta, xlm-roberta-xl, xlnet, xmod, yolos, yoso, zoedepth, chatglm, jais, mlp_speculator, medusa, eagle, exaone, internvl_chat, solar, ultravox, mllamaExpected behavior / 期待表现
希望可以使用openai的demo调用我自己微调后的模型进行数据测试