mirror of
https://github.com/QwenLM/Qwen.git
synced 2026-05-21 00:45:48 +08:00
Merge pull request #476 from dlutsniper/main
Update finetune.py For lower cpu memory
This commit is contained in:
@@ -278,7 +278,7 @@ def train():
|
|||||||
|
|
||||||
local_rank = training_args.local_rank
|
local_rank = training_args.local_rank
|
||||||
|
|
||||||
device_map = None
|
device_map = "auto"
|
||||||
world_size = int(os.environ.get("WORLD_SIZE", 1))
|
world_size = int(os.environ.get("WORLD_SIZE", 1))
|
||||||
ddp = world_size != 1
|
ddp = world_size != 1
|
||||||
if lora_args.q_lora:
|
if lora_args.q_lora:
|
||||||
@@ -302,6 +302,7 @@ def train():
|
|||||||
config=config,
|
config=config,
|
||||||
cache_dir=training_args.cache_dir,
|
cache_dir=training_args.cache_dir,
|
||||||
device_map=device_map,
|
device_map=device_map,
|
||||||
|
low_cpu_mem_usage=True if training_args.use_lora and not lora_args.q_lora,
|
||||||
trust_remote_code=True,
|
trust_remote_code=True,
|
||||||
quantization_config=GPTQConfig(
|
quantization_config=GPTQConfig(
|
||||||
bits=4, disable_exllama=True
|
bits=4, disable_exllama=True
|
||||||
|
|||||||
Reference in New Issue
Block a user