Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: lora_training | |
channels: | |
- pytorch | |
- conda-forge | |
dependencies: | |
- cudatoolkit-dev=11.3.1 | |
- numpy=1.24.2 | |
- pip=23.0.1 | |
- python=3.8.16 | |
- pip: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Modified from https://github.com/lvwerra/trl/blob/main/examples/sentiment/scripts/gpt-neox-20b_peft/merge_peft_adapter.py | |
import argparse | |
import os | |
import peft | |
import torch | |
from peft import PeftConfig, PeftModel | |
from transformers import AutoTokenizer, T5ForConditionalGeneration | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compute_environment: LOCAL_MACHINE | |
deepspeed_config: | |
gradient_accumulation_steps: 22 | |
offload_optimizer_device: cpu | |
offload_param_device: cpu | |
zero3_init_flag: true | |
zero3_save_16bit_model: false | |
zero_stage: 3 | |
distributed_type: DEEPSPEED | |
downcast_bf16: 'no' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Modified from https://github.com/huggingface/peft/blob/main/examples/conditional_generation/peft_lora_seq2seq_accelerate_ds_zero3_offload.py | |
import argparse | |
import gc | |
import logging | |
import os | |
import threading | |
import psutil | |
import torch | |
from accelerate import Accelerator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import pandas as pd | |
with open('alpaca_data.json') as f: | |
data = json.load(f) | |
new_format = [] | |
for i, point in enumerate(data): |