MCPcopy Create free account
hub / github.com/TonyLianLong/LLM-groundedDiffusion / add_cache

Function add_cache

utils/cache.py:60–71  ·  view source on GitHub ↗
(key, value)

Source from the content-addressed store, hash-verified

58 return None
59
60def add_cache(key, value):
61 global_cache_index[key] += 1
62 global_cache[key].append(value)
63
64 if cache_format == "pickle":
65 with open(cache_path, 'wb') as f:
66 pickle.dump(global_cache, f)
67 elif cache_format == "json":
68 with open(cache_path, 'w') as f:
69 json.dump(global_cache, f, indent=4)
70
71 return value
72
73def pkl_to_json(filename):
74 assert 'pkl' in filename, filename

Callers 1

get_layout_with_cacheFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected