Download run.py from aiflows/MemoryReadingFlowModule: direct link, hf CLI and curl.
- Browser
- Download file 1.34 kB
-
https://huggingface.co/aiflows/MemoryReadingFlowModule/resolve/bf33d37163a52cc899db7521d00ab9e38c7f81e2/run.py
- Command line
-
hf download hf://aiflows/MemoryReadingFlowModule@bf33d37163a52cc899db7521d00ab9e38c7f81e2/run.py
-
curl -L -o run.py https://huggingface.co/aiflows/MemoryReadingFlowModule/resolve/bf33d37163a52cc899db7521d00ab9e38c7f81e2/run.py
1.34 kB
| import os | |
| import hydra | |
| from aiflows.backends.api_info import ApiInfo | |
| from aiflows.messages import InputMessage | |
| from aiflows.utils.general_helpers import read_yaml_file | |
| from aiflows import logging | |
| from aiflows.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": "aiflows/MemoryReadingFlowModule", "revision": "main"}, | |
| ] | |
| from aiflows import flow_verse | |
| flow_verse.sync_dependencies(dependencies) | |
| if __name__ == "__main__": | |
| current_dir = os.getcwd() | |
| cfg_path = os.path.join(current_dir, "MemoryReadingAtomicFlow.yaml") | |
| cfg = read_yaml_file(cfg_path) | |
| MemReadFlow = hydra.utils.instantiate(cfg, _recursive_=False, _convert_="partial") | |
| input_data = { | |
| "memory_files": { | |
| "plan": os.path.join(current_dir, "example_plan.txt"), | |
| "logs": os.path.join(current_dir, "example_logs.txt"), | |
| "code_library": os.path.join(current_dir, "example_library.py") | |
| } | |
| } | |
| input_message = InputMessage.build( | |
| data_dict=input_data, | |
| src_flow="Launcher", | |
| dst_flow=MemReadFlow.name | |
| ) | |
| # ~~~ calling the flow ~~~ | |
| output_message = MemReadFlow(input_message) | |
| print(output_message.data) |