support QLoRA

Former-commit-id: d89597e28fe9b91246e58c55eeb9082436940481
This commit is contained in:
hiyouga
2023-06-04 00:08:56 +08:00
parent 2308d5a179
commit 5f44112cf5
3 changed files with 48 additions and 12 deletions

View File

@@ -1,5 +1,6 @@
import os
import json
import torch
from typing import List, Literal, Optional
from dataclasses import asdict, dataclass, field
@@ -207,6 +208,10 @@ class FinetuningArguments:
LLaMA choices: [\"q_proj\", \"k_proj\", \"v_proj\", \"o_proj\", \"up_proj\", \"down_proj\"], \
BLOOM choices: [\"query_key_value\", \"dense\", \"dense_\"]"}
)
compute_dtype: Optional[torch.dtype] = field(
default=None,
metadata={"help": "Used in quantization configs. Do not specify this argument manually."}
)
def __post_init__(self):
if isinstance(self.lora_target, str):