mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-08-02 01:47:43 +00:00
fix: fix a small bug in cache using module name and function name as unique folder name (#429)
This commit is contained in:
@@ -125,7 +125,9 @@ def cache_with_pickle(hash_func: Callable, post_process_func: Callable | None =
|
||||
@functools.wraps(func)
|
||||
def cache_wrapper(*args: Any, **kwargs: Any) -> Any:
|
||||
if RD_AGENT_SETTINGS.cache_with_pickle:
|
||||
target_folder = Path(RD_AGENT_SETTINGS.pickle_cache_folder_path_str) / func.__module__
|
||||
target_folder = (
|
||||
Path(RD_AGENT_SETTINGS.pickle_cache_folder_path_str) / f"{func.__module__}.{func.__name__}"
|
||||
)
|
||||
target_folder.mkdir(parents=True, exist_ok=True)
|
||||
hash_key = hash_func(*args, **kwargs)
|
||||
if hash_key is not None and (target_folder / (hash_key + ".pkl")).exists():
|
||||
|
||||
Reference in New Issue
Block a user