Download run_memwrite.py from Tachi67/MemoryWritingFlowModule: direct link, hf CLI and curl.
- Browser
- Download file 1.31 kB
-
https://huggingface.co/Tachi67/MemoryWritingFlowModule/resolve/3fb58a0c0ba23135aea67e03cc8b7c74053ddbf5/run_memwrite.py
- Command line
-
hf download hf://Tachi67/MemoryWritingFlowModule@3fb58a0c0ba23135aea67e03cc8b7c74053ddbf5/run_memwrite.py
-
curl -L -o run_memwrite.py https://huggingface.co/Tachi67/MemoryWritingFlowModule/resolve/3fb58a0c0ba23135aea67e03cc8b7c74053ddbf5/run_memwrite.py
1.31 kB
| import os | |
| import hydra | |
| from flows.backends.api_info import ApiInfo | |
| from flows.messages import InputMessage | |
| from flows.utils.general_helpers import read_yaml_file | |
| from flows import logging | |
| from flows.flow_cache import CACHING_PARAMETERS, clear_cache | |
| CACHING_PARAMETERS.do_caching = False # Set to True in order to disable caching | |
| logging.set_verbosity_debug() | |
| logging.auto_set_dir() | |
| dependencies = [ | |
| {"url": "Tachi67/MemoryWritingFlowModule", "revision": "main"}, | |
| ] | |
| from flows import flow_verse | |
| flow_verse.sync_dependencies(dependencies) | |
| if __name__ == "__main__": | |
| current_dir = os.getcwd() | |
| cfg_path = os.path.join(current_dir, "MemoryWritingAtomicFlow.yaml") | |
| cfg = read_yaml_file(cfg_path) | |
| MemWriteFlow = hydra.utils.instantiate(cfg, _recursive_=False, _convert_="partial") | |
| logs_file_location = os.path.join(current_dir, "logs.txt") | |
| with open(logs_file_location, 'w') as file: | |
| pass | |
| input_data = { | |
| "summary": "mama~~~~~~~~ just killed a man", | |
| "memory_files": { | |
| "logs": logs_file_location | |
| } | |
| } | |
| input_message = InputMessage.build( | |
| data_dict=input_data, | |
| src_flow="Launcher", | |
| dst_flow=MemWriteFlow.name | |
| ) | |
| # ~~~ calling the flow ~~~ | |
| output_message = MemWriteFlow(input_message) | |