Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix model downloading for CPU-only servers #651

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/lmflow/models/hf_decoder_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,11 @@ def __init__(
replace_llama_with_condense(model_args.rope_pi_ratio, model_args.rope_ntk_ratio)

# Whether use flash attention
supported_gpu_device = None
for gpu in GPU_SUPPORT_FLASH_ATTENTION:
if gpu in torch.cuda.get_device_name():
supported_gpu_device = gpu
if model_args.use_flash_attention:
supported_gpu_device = None
for gpu in GPU_SUPPORT_FLASH_ATTENTION:
if gpu in torch.cuda.get_device_name():
supported_gpu_device = gpu
if not any(model_supported in config.architectures
for model_supported in MODELS_SUPPORT_FLASH_ATTENTION):
logger.warning(
Expand Down