为了节省显存,给LLM加上LoRA,并且同时打开gradient_checkpointing之后,再修改embedding就会报错。 通过一步一步的研究,发现是huggingface的enable_input_require_grads函数将inputs_embeds变成了需要梯度的叶子结点。最终解决方案是通过clone操作将inputs_embeds再变成非叶子结点,再修改对应的embedding: inputs_embeds = input...
huggingface/transformersPublic NotificationsYou must be signed in to change notification settings Fork26.5k Star133k New issue More preciseinputs_embedsinput logic and tests#32913 Open ganteopened this issueAug 21, 2024· 0 comments Member
To access it, install the latest version:pip install --upgrade git+https://github.com/huggingface/transformers.git EDIT: as of 2023-Mar-16, you can access this feature by installingv4.27. There are a few models with soft-prompting enabled -- try running it and, if the model lacks suppor...
wav*_*per 5 python deep-learning torchscript huggingface-transformers 尝试将 t5 模型转换question-generation为torchscript model,同时执行此操作时遇到此错误ValueError:您必须指定decoder_input_ids或decoder_inputs_embeds这是我在 colab 上运行的代码。!pip install -U transformers==3.0.0 !python -m nltk.dow...
I'm not 100% sure what you want to do here exactly. T5 is always trained in a text-to-text format. We have a section here on how to train T5:https://huggingface.co/transformers/model_doc/t5.html#training Otherwise I'd recommend taking a look at the official paper. ...