feat: 양자화 설정에 따라 device_map 자동 전환 기능 추가

This commit is contained in:
2025-08-28 10:47:44 +09:00
parent 96b0bf608d
commit 8ffed1c502

View File

@@ -35,7 +35,7 @@ def download_model(config_path='./config.json'):
model_name,
cache_dir=local_path,
quantization_config=quantization_config,
device_map="cpu", # 다운로드 시 CPU에 로드하여 메모리 절약
device_map="auto" if quantization_config else "cpu", # 양자화 시 auto, 아니면 cpu
torch_dtype="auto"
)
tokenizer = AutoTokenizer.from_pretrained(