Skip to content

Commit

Permalink
added aquila2 finetuning
Browse files Browse the repository at this point in the history
Signed-off-by: 严照东 <[email protected]>
  • Loading branch information
严照东 committed Oct 7, 2023
1 parent 874490b commit f773711
Show file tree
Hide file tree
Showing 5 changed files with 1,582 additions and 2 deletions.
6 changes: 4 additions & 2 deletions flagai/auto_model/auto_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ def __init__(self,
model = AquilaForCausalLM.from_pretrained(download_path,low_cpu_mem_usage=low_cpu_mem_usage, torch_dtype=torch_dtype,
quantization_config=quantization_config)
model.eval()
if not qlora_dir:
model.to(device)
else:
# Set RoPE scaling factor
import transformers
Expand All @@ -285,8 +287,8 @@ def __init__(self,
**kwargs)


if not qlora_dir:
model.to(device)
#if not quantization_config:
# model.to(device)
if lora_dir:
from flagai.model.tools.peft import PeftModel
model = PeftModel.from_pretrained(model, lora_dir)
Expand Down
Loading

0 comments on commit f773711

Please sign in to comment.