Skip to content

Commit b612ef8

Browse files
authored
Merge pull request #7 from devoc09/fix/use-sys-executable-path
fix: Use sys.executable for mlx_lm subprocess call
2 parents de5e449 + 26f7fae commit b612ef8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/plamo_translate/servers/mlx/server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import logging
55
import os
66
import subprocess
7+
import sys
78
from typing import Callable, Tuple
89

910
import mlx.core as mx
@@ -88,7 +89,7 @@ def load_model(self) -> Tuple[nn.Module, TokenizerWrapper, Callable[..., mx.arra
8889
envs = os.environ
8990
envs["HF_HUB_DISABLE_PROGRESS_BARS"] = "0"
9091
subprocess.run(
91-
["python", "-m", "mlx_lm", "generate", "--model", model_name, "--max-tokens", "1"],
92+
[sys.executable, "-m", "mlx_lm", "generate", "--model", model_name, "--max-tokens", "1"],
9293
env=envs,
9394
stdout=subprocess.DEVNULL,
9495
)

0 commit comments

Comments
 (0)