ludwig 无法微调GPTQ模型

b09cbbtk  于 2个月前  发布在  其他
关注(0)|答案(6)|浏览(33)

Describe the bug

I am trying to finetune an already quantized model (GPTQ) using ludwig but have been running into the following error:
AttributeError: 'BitsAndBytesConfig' object has no attribute 'get_loading_attributes'

To Reproduce

Steps to reproduce the behavior:
import yaml
config_str = """
model_type: llm
base_model: TheBloke/Llama-2-13B-GPTQ
quantization:
bits: 4
adapter:
type: lora
generation:
temperature: 0.1
max_new_tokens: 256
prompt:
template: |

Instruction:

{instruction}

### Input:
{input}

### Response:

input_features:

  • name: prompt

type: text
preprocessing:
max_sequence_length: 256
output_features:

  • name: output

type: text
preprocessing:
max_sequence_length: 256
trainer:
type: finetune
learning_rate: 0.0001
batch_size: 2
gradient_accumulation_steps: 3
epochs: 15
learning_rate_scheduler:
warmup_fraction: 0.01
preprocessing:
global_max_sequence_length: 512
split_probabilities: [0.9,0.1, 0.0]
sample_ratio: 1
"""
config = yaml.safe_load(config_str)
import logging
from ludwig.api import LudwigModel
model = LudwigModel(config=config, logging_level=logging.INFO)
results = model.train(dataset=df)

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]
  • Python version
  • Ludwig version
    Additional context

Add any other context about the problem here.

noj0wjuj

noj0wjuj1#

你好,mani1491,感谢你指出这个问题。
请问你目前运行的Ludwig版本是什么?
如果你能告诉我你当前正在运行的transformersbitsandbytes包的版本,那就太好了。

yhxst69z

yhxst69z2#

你好,@arnavgarg1,这里是版本信息:
ludwig 0.8.4
transformers: 4.33.2
bitsandbytes: 0.40.2
请注意,我的基础模型本身是量化的。这可能是问题所在吗?
基础模型:TheBloke/Llama-2-13B-GPTQ

cyvaqqii

cyvaqqii3#

据我所知,我们目前还不支持微调GPTQ模型。这是可能的,但需要我们的一些努力才能实现。

xj3cbfub

xj3cbfub4#

感谢回复。如果目前不支持GPTQ模型,有没有办法在免费的谷歌Colab示例(15GB GPU)上微调llama-2 7B?即使是小数据集,笔记本的内存也不足。如果这不是预期的情况,我想了解是否遗漏了任何内容。

h43kikqp

h43kikqp5#

感谢回复。如果目前不支持GPTQ模型,那么有没有办法在免费的谷歌Colab示例(15GB GPU)上微调llama-2 7B?即使是小数据集,笔记本的内存也不足。如果这不是预期的情况,我想了解是否遗漏了任何内容。
我按照这个说明进行了操作:https://ludwig.ai/latest/getting_started/llm_finetuning/,使用Colab并将运行时更改为T4 GPU,它可以正常工作。

p8h8hvxi

p8h8hvxi6#

根据我所知,我们目前还不支持微调GPTQ模型。虽然这是可能的,但我们需要做一些工作来实现它。
你好,我想参与这个项目并为其做出贡献,你能提供一些指导吗?

相关问题