Skip to content

Commit

Permalink
use cached_property instead
Browse files Browse the repository at this point in the history
  • Loading branch information
winglian committed Nov 21, 2024
1 parent 86c6474 commit e66e5e0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/axolotl/utils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import math
import os
import types
from functools import cached_property
from typing import Any, Dict, Optional, Tuple, Union # noqa: F401

import addict
Expand Down Expand Up @@ -452,7 +453,7 @@ def patch_attention(self) -> None:

replace_stablelm_attn_with_flash_attn(self.cfg.base_model)

@property
@cached_property
def flash_attn(self) -> bool:
"""Check if flash attention is installed"""
return importlib.util.find_spec("flash_attn") is not None
Expand Down

0 comments on commit e66e5e0

Please sign in to comment.