Skip to content

Commit f5834ce

Browse files
Make kwargs optional to the eval output customizer scripts (#139)
This pull request makes the keyword arguments for the evaluation output customizer scripts optional, allowing users to omit them. Key changes include: Updating EvalCustomScriptConfig in evaluate.py to set a default empty dictionary for kwargs. Changing the workflow_to_csv.py script’s argument parser to use default values for input and output paths. Revising the documentation to reflect the new usage and relative paths. ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AgentIQ/blob/develop/docs/source/advanced/contributing.md). - We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license. - Any contribution which contains commits that are not Signed-Off will not be accepted. - When the PR is ready for review, new or existing tests cover these changes. - When the PR is ready for review, the documentation is up to date with these changes. Authors: - Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah) Approvers: - Yuchen Zhang (https://github.com/yczhang-nv) URL: #139
1 parent 74f5687 commit f5834ce

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

docs/source/concepts/evaluate.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,9 @@ eval:
331331
convert_workflow_to_csv:
332332
script: examples/simple/src/aiq_simple/scripts/workflow_to_csv.py
333333
kwargs:
334-
input: ./.tmp/aiq/examples/simple_output/workflow_output.json
335-
output: ./.tmp/aiq/examples/simple_output/workflow.csv
334+
# The input and output are relative to the output directory
335+
input: workflow_output.json
336+
output: workflow.csv
336337
```
337338
338339
## Remote Storage

examples/simple/src/aiq_simple/scripts/workflow_to_csv.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ def parse_args():
5757
parser = argparse.ArgumentParser(description="Convert workflow_output.json to workflow.csv")
5858
# output_dir is a mandatory first argument
5959
parser.add_argument("--output_dir", type=Path, required=True, help="Path to output directory")
60-
parser.add_argument("--input", type=Path, required=True, help="Path to workflow_output.json")
61-
parser.add_argument("--output", type=Path, required=True, help="Path to output CSV")
60+
parser.add_argument("--input", type=Path, default="workflow_output.json", help="Path to workflow_output.json")
61+
parser.add_argument("--output", type=Path, default="workflow.csv", help="Path to output CSV")
6262
return parser.parse_args()
6363

6464

src/aiq/data_models/evaluate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class EvalCustomScriptConfig(BaseModel):
3131
# Path to the script to run
3232
script: Path
3333
# Keyword arguments to pass to the script
34-
kwargs: dict[str, str]
34+
kwargs: dict[str, str] = {}
3535

3636

3737
class EvalOutputConfig(BaseModel):

0 commit comments

Comments
 (0)