From 5140804f755c1defb06722cac6b41850a35aad57 Mon Sep 17 00:00:00 2001 From: isaacJinyu <1376193973@qq.com> Date: Fri, 7 Feb 2025 17:23:03 +0800 Subject: [PATCH] add file_tree to SPO's README.md --- examples/spo/README.md | 25 +++++++++++++++++++++++++ metagpt/ext/spo/utils/load.py | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/examples/spo/README.md b/examples/spo/README.md index 16ff7835a..fe22fc80f 100644 --- a/examples/spo/README.md +++ b/examples/spo/README.md @@ -103,3 +103,28 @@ ### 3. Implement the Optimizer 🔧 ```bash python optimize.py --help ``` + +### 4. View Results +``` +workspace + └── Project_name + └── prompts + ├── results.json + ├── round_1 + │ ├── answers.txt + │ └── prompt.txt + ├── round_2 + │ ├── answers.txt + │ └── prompt.txt + ├── round_3 + │ ├── answers.txt + │ └── prompt.txt + ├── ... + └── round_n + ├── answers.txt + └── prompt.txt +``` + +- `results.json`: Stores whether each iteration round was judged successful and other related information +- `prompt.txt`: The optimized prompt for the corresponding round +- `answers.txt`: The output results generated using the prompt for the corresponding round diff --git a/metagpt/ext/spo/utils/load.py b/metagpt/ext/spo/utils/load.py index cd282ff7d..2e931a615 100644 --- a/metagpt/ext/spo/utils/load.py +++ b/metagpt/ext/spo/utils/load.py @@ -13,7 +13,7 @@ def set_file_name(name): def load_meta_data(k=SAMPLE_K): # load yaml file - config_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'settings', FILE_NAME) + config_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'settings', FILE_NAME) with open(config_path, 'r', encoding='utf-8') as file: data = yaml.safe_load(file)