Skip to content

Commit 3a9df5f

Browse files
committed
Fix batch launch script generation for bind path, mypy and ruff fixes
1 parent 4a22fe6 commit 3a9df5f

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

vec_inf/client/_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ def _get_launch_params(
554554
raise ValueError(
555555
f"Mismatch found for {arg}: {params[arg]} != {params['models'][model_name][arg]}, check your configuration"
556556
)
557-
# Check for required fields without default vals, will raise an error if missing
557+
# Check for required fields, will raise an error if missing any
558558
utils.check_required_fields(
559559
{**params["models"][model_name], **common_params}
560560
)

vec_inf/client/_slurm_script_generator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ def __init__(self, params: dict[str, Any]):
219219
self.use_container = self.params["venv"] == CONTAINER_MODULE_NAME
220220
for model_name in self.params["models"]:
221221
self.params["models"][model_name]["additional_binds"] = (
222-
f",{self.params['bind']}" if self.params.get("bind") else ""
222+
f",{self.params['models'][model_name]['bind']}"
223+
if self.params["models"][model_name].get("bind")
224+
else ""
223225
)
224226
self.params["models"][model_name]["model_weights_path"] = str(
225227
Path(

vec_inf/client/_slurm_templates.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ class BatchModelLaunchScriptTemplate(TypedDict):
215215
Shebang line for the script
216216
container_setup : list[str]
217217
Commands for container setup
218-
bind_path : list[str]
218+
bind_path : str
219219
Bind path environment variable for the container
220220
server_address_setup : list[str]
221221
Commands to setup the server address
@@ -227,7 +227,7 @@ class BatchModelLaunchScriptTemplate(TypedDict):
227227

228228
shebang: str
229229
container_setup: str
230-
bind_path: list[str]
230+
bind_path: str
231231
server_address_setup: list[str]
232232
write_to_json: list[str]
233233
launch_cmd: list[str]

0 commit comments

Comments
 (0)