MCPcopy Create free account
hub / github.com/CoopReason/TESSY / load_processed_ids

Function load_processed_ids

utils.py:127–139  ·  view source on GitHub ↗
(path_save: str)

Source from the content-addressed store, hash-verified

125
126
127def load_processed_ids(path_save: str) -> set:
128 if not os.path.exists(path_save):
129 return set()
130 with open(path_save, encoding="utf-8") as f:
131 lines = [json.loads(l) for l in f.readlines()]
132 if not lines:
133 return set()
134 if lines and "id_ddm" in lines[0]:
135 return {l["id_ddm"] for l in lines}
136 elif lines and "prompt" in lines[0]:
137 return {get_hashes_and_lines(l.get("prompt", "")) for l in lines}
138 else:
139 return set()

Callers 1

async_mainFunction · 0.70

Calls 1

get_hashes_and_linesFunction · 0.70

Tested by

no test coverage detected