diff --git a/.semversioner/next-release/patch-20240919000033794082.json b/.semversioner/next-release/patch-20240919000033794082.json new file mode 100644 index 0000000000..522e6050c2 --- /dev/null +++ b/.semversioner/next-release/patch-20240919000033794082.json @@ -0,0 +1,4 @@ +{ + "type": "patch", + "description": "Fix prompt tune output path" +} diff --git a/graphrag/prompt_tune/__main__.py b/graphrag/prompt_tune/__main__.py index 1db893f2ff..aac668dba1 100644 --- a/graphrag/prompt_tune/__main__.py +++ b/graphrag/prompt_tune/__main__.py @@ -92,7 +92,7 @@ ) parser.add_argument( "--output", - help="Directory to save generated prompts to. Default: 'prompts'", + help="Directory to save generated prompts to, relative to the root directory. Default: 'prompts'", type=str, default="prompts", ) diff --git a/graphrag/prompt_tune/cli.py b/graphrag/prompt_tune/cli.py index 0f4c795bf1..dd964260ca 100644 --- a/graphrag/prompt_tune/cli.py +++ b/graphrag/prompt_tune/cli.py @@ -43,7 +43,7 @@ async def prompt_tune( - chunk_size: The chunk token size to use. - language: The language to use for the prompts. - skip_entity_types: Skip generating entity types. - - output: The output folder to store the prompts. + - output: The output folder to store the prompts. Relative to the root directory. - n_subset_max: The number of text chunks to embed when using auto selection method. - k: The number of documents to select when using auto selection method. - min_examples_required: The minimum number of examples required for entity extraction prompts. @@ -67,7 +67,7 @@ async def prompt_tune( k=k, ) - output_path = Path(output).resolve() + output_path = (root_path / output).resolve() if output_path: reporter.info(f"Writing prompts to {output_path}") output_path.mkdir(parents=True, exist_ok=True)