Instructions to use dbaysal/code-unit-unlearning-qwen2_5_coder_3b-prod with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use dbaysal/code-unit-unlearning-qwen2_5_coder_3b-prod with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-3B") model = PeftModel.from_pretrained(base_model, "dbaysal/code-unit-unlearning-qwen2_5_coder_3b-prod") - Notebooks
- Google Colab
- Kaggle
File size: 3,673 Bytes
897fc52 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | mode: unlearn
task_name: custom_hf_code_unit_qwen2_5_coder_3b_prod
model:
model_args:
pretrained_model_name_or_path: Qwen/Qwen2.5-Coder-3B
attn_implementation: flash_attention_2
torch_dtype: bfloat16
peft_name: dbaysal/qwen2.5coder-3b-learned
peft_checkpoint_subfolder: checkpoint-282
tokenizer_args:
pretrained_model_name_or_path: Qwen/Qwen2.5-Coder-3B
template_args:
apply_chat_template: false
system_prompt: You are a helpful assistant.
system_prompt_with_special_tokens: '<|begin_of_text|><|start_header_id|>system<|end_header_id|>
You are a helpful assistant.<|eot_id|>'
user_start_tag: ''
user_end_tag: ''
asst_start_tag: ''
asst_end_tag: ''
date_string: 10 Apr 2025
trainer:
handler: PROD
args:
per_device_train_batch_size: 4
per_device_eval_batch_size: 16
gradient_accumulation_steps: 8
learning_rate: 0.0003
bf16: true
bf16_full_eval: false
logging_steps: 1
output_dir: ./saves/unlearn/custom_hf_code_unit_qwen2_5_coder_3b_prod
logging_dir: ./saves/unlearn/custom_hf_code_unit_qwen2_5_coder_3b_prod/logs
report_to: tensorboard
ddp_find_unused_parameters: None
gradient_checkpointing: false
optim: adamw_torch
save_strategy: epoch
save_only_model: true
weight_decay: 0.0
do_train: true
do_eval: false
eval_on_start: false
eval_strategy: 'no'
num_train_epochs: 3
seed: 42
save_total_limit: null
overwrite_output_dir: true
lr_scheduler_type: constant
fp16: false
remove_unused_columns: false
method_args:
gamma: 1.0
alpha: 0.0
retain_loss_type: NLL
top_p: 0.8
temperature: null
'N': 1
max_N: null
prod_alpha: 0.0
reference_model_args:
load_in_8bit: true
data:
forget:
CustomHF_forget:
handler: CompletionDataset
args:
hf_args:
path: dbaysal/forget
split: train
text_key: code
max_length: 2056
prefix_key: check
retain:
CustomHF_retain:
handler: CompletionDataset
args:
hf_args:
path: dbaysal/retain-half
split: train
text_key: code
max_length: 2056
prefix_key: check
anchor: forget
batch_mode: paired
batch_order: random
collator:
DataCollatorForSupervisedDataset:
handler: DataCollatorForSupervisedDataset
args:
padding_side: left
codecarbon:
enabled: true
project_name: custom_hf_code_unit_qwen2_5_coder_3b_prod
output_dir: ./saves/unlearn/custom_hf_code_unit_qwen2_5_coder_3b_prod/emissions
output_file: emissions.csv
measure_power_secs: 15
log_level: error
save_to_file: true
hub_adapter:
enabled: true
repo_id: dbaysal/code-unit-unlearning-qwen2_5_coder_3b-prod
private: null
repo_type: model
revision: null
path_in_repo: null
create_pr: false
token: null
folder_path: ./saves/unlearn/custom_hf_code_unit_qwen2_5_coder_3b_prod
commit_message: null
commit_description: null
include_checkpoints: true
include_tokenizer: true
include_emissions: true
include_settings: true
allow_patterns: null
ignore_patterns: null
delete_patterns: null
paths:
root_dir: .
data_dir: ./data/
datasets: ./configs/data/datasets
output_dir: ./saves/unlearn/custom_hf_code_unit_qwen2_5_coder_3b_prod
work_dir: /workspace/Code-Unlearning/open-unlearning
method_name: prod
model_name: qwen2_5_coder_3b
unlearning_task: code_unit
forget_dataset_path: dbaysal/forget
forget_split: train
retain_dataset_path: dbaysal/retain-half
retain_split: train
prefix_key: check
text_key: code
forget_text_key: code
retain_text_key: code
max_length: 2056
|