Skip to content

Commit

Permalink
Merge pull request #541 from Anhforth/master
Browse files Browse the repository at this point in the history
fixed bug
  • Loading branch information
BAAI-OpenPlatform authored Oct 7, 2023
2 parents e1e0116 + df9c0c2 commit ae439ea
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions flagai/auto_model/auto_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,11 @@ def __init__(self,
bnb_4bit_compute_dtype=torch_dtype,
)
if inference_mode:
model = AquilaForCausalLM.from_pretrained(download_path,low_cpu_mem_usage=low_cpu_mem_usage, torch_dtype=torch_dtype,
quantization_config=quantization_config)
if qlora_dir:
model = AquilaForCausalLM.from_pretrained(download_path,low_cpu_mem_usage=low_cpu_mem_usage, torch_dtype=torch_dtype,
quantization_config=quantization_config)
else:
model = AquilaForCausalLM.from_pretrained(download_path,low_cpu_mem_usage=low_cpu_mem_usage, torch_dtype=torch_dtype,)
model.eval()
if not qlora_dir:
model.to(device)
Expand Down

0 comments on commit ae439ea

Please sign in to comment.