mirror of
https://github.com/xai-org/grok-1.git
synced 2024-11-23 03:59:53 +03:00
Set maxsize to 32MB in lru_cache() for reasonable memory usage
This commit is contained in:
parent
5fc82399bf
commit
104affb51a
@ -141,7 +141,7 @@ def path_tuple_to_string(path: tuple) -> str:
|
|||||||
For get_load_path_str(),
|
For get_load_path_str(),
|
||||||
introducing a simple caching mechanism to avoid recomputing regex matches for paths that have already been processed.
|
introducing a simple caching mechanism to avoid recomputing regex matches for paths that have already been processed.
|
||||||
"""
|
"""
|
||||||
@lru_cache(maxsize=None)
|
@lru_cache(maxsize=32) # Set maxsize to 32MB
|
||||||
def get_load_path_str_cached(
|
def get_load_path_str_cached(
|
||||||
init_path_str: str,
|
init_path_str: str,
|
||||||
load_rename_rules: Optional[list[tuple[str, str]]] = None,
|
load_rename_rules: Optional[list[tuple[str, str]]] = None,
|
||||||
|
Loading…
Reference in New Issue
Block a user