Aamir ali Khan
Aamir ali Khan
@dosu How can we filter based on text? I am trying this ```python from copy import deepcopy # If needed, import DocItemLabel and ContentLayer enums or use strings doc_copy =...
This works. Thanks for your support @dosu
Removing 'score' layer from target_modules resolves the above mentioned error but now I am getting this error: _IncompatibleKeys(missing_keys=['base_model.model.model.embed_tokens.weight', 'base_model.model.model.layers.0.self_attn.q_proj.weight', ..., ..., 'base_model.model.model.layers.31.mlp.down_proj.lora_A.default.weight', 'base_model.model.model.layers.31.mlp.down_proj.lora_B.default.weight', 'base_model.model.model.layers.31.input_layernorm.weight', 'base_model.model.model.layers.31.post_attention_layernorm.weight', 'base_model.model.model.norm.weight', 'base_model.model.score.original_module.weight', 'base_model.model.score.modules_to_save.default.weight'], unexpected_keys=['base_model.model.score.modules_to_save.ranking.weight'])
> You probably have to retrain the models without the score layer in target_modules. I removed the score layer from target_modules and Value Error is gone but now I am...
Code for loading the first adapter: ```python def load_base_model(device, config, reward_model): bnb_config = initialize_bnb_config(config) model_args = { "torch_dtype": bnb_config.bnb_4bit_compute_dtype, "quantization_config": bnb_config, "cache_dir": CACHE_DIR, "device_map": device } if reward_model: return transformers.AutoModelForSequenceClassification.from_pretrained(...
I retrained the adapters after removing 'score' from target_modules and now I am able to load multiple adapters and get predictions from them. However, the warning `_IncompatibleKeys` is still there....
Passing the based model to`AutoModelForCausalLMWithValueHead.from_pretrained` instead of `AutoModelForCausalLMWithValueHead` resolve this problem. However, I checked the [source code](https://github.com/huggingface/trl/blob/main/trl/models/modeling_base.py#L224) and found the gradient_checkpointing is done by default using `prepare_model_for_kbit_training`, so I guess...
I monitored each step and found that the `generate` step takes (30min to 1 hour) more time than the optimization step. This only happens when `gradient_checkpointing` is enabled otherwise it...
I updated the code for manually disabling and enabling the checkpointing and it does make a lot of difference. Now each step takes 7 minutes on average (generation + optimization)....
Yes I am already using QLora with the following config ```python dtype = torch.bfloat16 lora_config = LoraConfig( r=64, lora_alpha=16, lora_dropout=0.1, bias="none", task_type="CAUSAL_LM", target_modules=["q_proj", "down_proj", "gate_proj", "o_proj", "k_proj", "v_proj", "up_proj" ]...