yangjianxin1 / Firefly

Firefly: 大模型训练工具,支持训练Qwen2.5、Qwen2、Yi1.5、Phi-3、Llama3、Gemma、MiniCPM、Yi、Deepseek、Orion、Xverse、Mixtral-8x7B、Zephyr、Mistral、Baichuan2、Llma2、Llama、Qwen、Baichuan、ChatGLM2、InternLM、Ziya2、Vicuna、Bloom等大模型
5.69k stars 518 forks source link

我用baichuan2-13B-base的模型微调,调完之后输出结果是空的 #163

Open dongxu opened 1 year ago

dongxu commented 1 year ago

截图 2023-09-27 15-18-34 如图所示,微调后输出都是空的,我是用的firefly自带的数据和参数做的

bank010 commented 12 months ago

您好,您微调baichuan2-13B-base时,loss是怎么变化的,我自定义数据集发现loss一直为0.0

xxlest commented 11 months ago

截图 2023-09-27 15-18-34 如图所示,微调后输出都是空的,我是用的firefly自带的数据和参数做的

这个问题解决了吗

hongshengxin commented 11 months ago

我的loss一直是0

chuxiliyixiaosa commented 11 months ago

我使用原始的百川2-7B-chat模型,用他们的推理代码也是空的。所以我觉得推理代码哪里有问题。 换成下面代码可以成功推理,但是要替换generation_config.json,用原始的。

import torch from transformers import AutoModelForCausalLM, AutoTokenizer from transformers.generation.utils import GenerationConfig tokenizer = AutoTokenizer.from_pretrained(微调以后模型路径, use_fast=False, trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained(微调以后模型路径, device_map="auto", torch_dtype=torch.bfloat16, trust_remote_code=True) model.generation_config = GenerationConfig.from_pretrained(微调以后模型路径) messages = [] messages.append({"role": "user", "content": "解释一下“温故而知新”"}) response = model.chat(tokenizer, messages) print(response)

然而有新的问题,似乎模型并没有学习进我的微调样本,训练的参数量太少了?

bank010 commented 11 months ago

"fp16": false, 就可以

delian11 commented 11 months ago

我的loss一直是0

您好,请问您loss一直是0的问题解决了吗?我也遇到这个问题

jiangSeu commented 11 months ago

"fp16": false, 就可以

请问这个在哪里改呢

bank010 commented 11 months ago

"fp16": false, 就可以

请问这个在哪里改呢

你的配置文件

mfxss commented 4 months ago

我用Baichuan2-chat loss也是0,改配置文件不生效。有两台A100,一台是0,一台就正常,后来把环境移植了一下就好了。 新环境的包我发出来,有两个包版本有问题单独修改一下就好了

两个环境,第一个是conda的环境,用conda导入,再pip install requirements.txt,这里Transformer用的4.34,不然保存会报错 name: py1 channels:

absl-py==2.0.0 accelerate==0.21.0 aiohttp==3.9.5 aiosignal==1.3.1 anyio==3.7.1 argon2-cffi==23.1.0 argon2-cffi-bindings==21.2.0 arrow==1.3.0 asttokens==2.4.1 astunparse==1.6.3 async-timeout==4.0.3 attrs==23.2.0 beautifulsoup4==4.12.3 bitsandbytes==0.39.0 bleach==6.1.0 cachetools==5.3.2 certifi==2023.7.22 cffi==1.16.0 charset-normalizer==3.3.1 click==8.1.7 cmake==3.29.3 comm==0.2.2 datasets==2.19.1 debugpy==1.8.1 decorator==5.1.1 deepspeed==0.9.5 defusedxml==0.7.1 dill==0.3.8 docstring_parser==0.16 einops==0.7.0 et-xmlfile==1.1.0 exceptiongroup==1.1.3 executing==2.0.1 fastapi==0.104.0 fastjsonschema==2.19.1 filelock==3.12.4 fqdn==1.5.1 frozenlist==1.4.1 fsspec==2023.10.0 google-auth==2.23.3 google-auth-oauthlib==1.1.0 greenlet==3.0.1 grpcio==1.59.0 h11==0.14.0 hjson==3.1.0 huggingface-hub==0.23.0 idna==3.4 ipykernel==6.29.4 ipython==8.24.0 isoduration==20.11.0 jedi==0.19.1 Jinja2==3.1.4 jsonlines==4.0.0 jsonpointer==2.4 jsonschema==4.22.0 jsonschema-specifications==2023.12.1 jupyter-events==0.10.0 jupyter_client==8.6.1 jupyter_core==5.7.2 jupyter_server==2.14.0 jupyter_server_terminals==0.5.3 jupyterlab_pygments==0.3.0 lit==18.1.4 loguru==0.7.0 Markdown==3.5 markdown-it-py==3.0.0 MarkupSafe==2.1.3 matplotlib-inline==0.1.7 mdurl==0.1.2 mistune==3.0.2 torch==2.0.0

mpi4py @ file:///croot/mpi4py_1671223370575/work

mpmath==1.3.0 multidict==6.0.5 multiprocess==0.70.16 nbclient==0.10.0 nbconvert==7.16.4 nbformat==5.10.4 nest-asyncio==1.6.0 networkx==3.3 ninja==1.11.1.1 numpy==1.26.1 nvidia-cublas-cu11==11.10.3.66 nvidia-cuda-cupti-cu11==11.7.101 nvidia-cuda-nvrtc-cu11==11.7.99 nvidia-cuda-runtime-cu11==11.7.99 nvidia-cudnn-cu11==8.5.0.96 nvidia-cufft-cu11==10.9.0.58 nvidia-curand-cu11==10.2.10.91 nvidia-cusolver-cu11==11.4.0.1 nvidia-cusparse-cu11==11.7.4.91 nvidia-nccl-cu11==2.14.3 nvidia-nvtx-cu11==11.7.91 oauthlib==3.2.2 openpyxl==3.1.2 overrides==7.7.0 packaging==23.2 pandas==2.1.2 pandocfilters==1.5.1 parso==0.8.4 peft==0.4.0 pexpect==4.9.0 platformdirs==4.2.1 prometheus_client==0.20.0 prompt-toolkit==3.0.43 protobuf==4.23.4 psutil==5.9.6 ptyprocess==0.7.0 pure-eval==0.2.2 py-cpuinfo==9.0.0 pyarrow==16.0.0 pyarrow-hotfix==0.6 pyasn1==0.5.0 pyasn1-modules==0.3.0 pycparser==2.22 pydantic==1.10.13 Pygments==2.18.0 PyMySQL==1.1.0 python-dateutil==2.8.2 python-json-logger==2.0.7 pytz==2023.3.post1 PyYAML==6.0.1 pyzmq==26.0.3 referencing==0.35.1 regex==2023.10.3 requests==2.31.0 requests-oauthlib==1.3.1 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 rich==13.7.1 rpds-py==0.18.1 rsa==4.9 safetensors==0.4.0 scipy==1.11.3 Send2Trash==1.8.3 sentencepiece==0.1.99 shtab==1.7.1 six==1.16.0 sniffio==1.3.0 soupsieve==2.5 SQLAlchemy==2.0.22 stack-data==0.6.3 starlette==0.27.0 sympy==1.12 tensorboard==2.15.0 tensorboard-data-server==0.7.2 terminado==0.18.1 tiktoken==0.5.1 tinycss2==1.3.0 tokenizers==0.15.2 tornado==6.4 tqdm==4.62.3 traitlets==5.14.3 transformers==4.34.0 transformers-stream-generator==0.0.4 triton==2.0.0 trl==0.8.6 types-python-dateutil==2.9.0.20240316 typing_extensions==4.8.0 tyro==0.8.4 tzdata==2023.3 uri-template==1.3.0 urllib3==2.0.7 uvicorn==0.23.2 wcwidth==0.2.13 webcolors==1.13 webencodings==0.5.1 websocket-client==1.8.0 Werkzeug==3.0.1 xxhash==3.4.1 yarl==1.9.4