Fix prompt tune output path on cli (#1157)

This commit is contained in:
Alonso Guevara 2024-09-19 09:22:17 -06:00 committed by GitHub
parent 3b09df6e07
commit ac234f47bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 3 deletions

View File

@ -0,0 +1,4 @@
{
"type": "patch",
"description": "Fix prompt tune output path"
}

View File

@ -92,7 +92,7 @@ if __name__ == "__main__":
)
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",
)

View File

@ -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)