feat: use Ornith-1.0-35B-FP8 with multi-GPU support
This commit is contained in:
@@ -39,10 +39,13 @@ def train(config_path):
|
||||
use_nested_quant=config.get("use_nested_quant", False),
|
||||
)
|
||||
|
||||
# Use all available GPUs
|
||||
device_map = "auto" if torch.cuda.device_count() == 1 else "balanced"
|
||||
|
||||
model = AutoModelForCausalLM.from_pretrained(
|
||||
config["base_model"],
|
||||
quantization_config=bnb_config,
|
||||
device_map="auto",
|
||||
device_map=device_map,
|
||||
)
|
||||
model = prepare_model_for_kbit_training(model)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user