You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set up default caching options for modelplane users (#67)
* Use num_workers to be consistent with modelgauge.
* Set up default caching options for SUT/annotator responses
* Replace `n_jobs` and `cache_dir` with `num_workers` in notebooks.
* Fixes.
* Explain caching in readme.md.
Copy file name to clipboardExpand all lines: src/modelplane/cli.py
+20-20Lines changed: 20 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -60,25 +60,25 @@ def list_suts_cli():
60
60
help="URL of the DVC repo to get the prompts from. E.g. https://github.com/my-org/my-repo.git. Can specify the revision using the `#` suffix, e.g. https://github.com/my-org/my-repo.git#main.",
61
61
)
62
62
@click.option(
63
-
"--cache_dir",
64
-
type=str,
65
-
default=None,
66
-
help="The cache directory. Defaults to None. Local directory used to cache LLM responses.",
63
+
"--disable_cache",
64
+
is_flag=True,
65
+
default=False,
66
+
help="Disable caching of LLM responses. If set, the pipeline will not cache SUT/annotator responses. Otherwise, cached responses will be stored locally in `.cache`.",
67
67
)
68
68
@click.option(
69
-
"--n_jobs",
69
+
"--num_workers",
70
70
type=int,
71
71
default=1,
72
-
help="The number of jobs to run in parallel. Defaults to 1.",
72
+
help="The number of workers to run in parallel. Defaults to 1.",
73
73
)
74
74
@load_from_dotenv
75
75
defget_sut_responses(
76
76
sut_id: str,
77
77
prompts: str,
78
78
experiment: str,
79
79
dvc_repo: str|None=None,
80
-
cache_dir: str|None=None,
81
-
n_jobs: int=1,
80
+
disable_cache: bool=False,
81
+
num_workers: int=1,
82
82
):
83
83
"""
84
84
Run the pipeline to get responses from SUTs.
@@ -88,8 +88,8 @@ def get_sut_responses(
88
88
prompts=prompts,
89
89
experiment=experiment,
90
90
dvc_repo=dvc_repo,
91
-
cache_dir=cache_dir,
92
-
n_jobs=n_jobs,
91
+
disable_cache=disable_cache,
92
+
num_workers=num_workers,
93
93
)
94
94
95
95
@@ -148,16 +148,16 @@ def get_sut_responses(
148
148
help="Use the response_run_id to save annotation artifact. Any existing annotation artifact will be overwritten. If not set, a new run will be created. Only applies if not using response_run_file.",
149
149
)
150
150
@click.option(
151
-
"--cache_dir",
152
-
type=str,
153
-
default=None,
154
-
help="The cache directory. Defaults to None. Local directory used to cache LLM responses.",
151
+
"--disable_cache",
152
+
is_flag=True,
153
+
default=False,
154
+
help="Disable caching of LLM responses. If set, the pipeline will not cache SUT/annotator responses. Otherwise, cached responses will be stored locally in `.cache`.",
155
155
)
156
156
@click.option(
157
-
"--n_jobs",
157
+
"--num_workers",
158
158
type=int,
159
159
default=1,
160
-
help="The number of jobs to run in parallel. Defaults to 1.",
160
+
help="The number of workers to run in parallel. Defaults to 1.",
0 commit comments