Skip to content

Commit 406e0e4

Browse files
committed
review comments
Signed-off-by: Kush Gupta <[email protected]>
1 parent 3f4b9b5 commit 406e0e4

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

ramalama/chat.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,7 @@ def __init__(self, args):
6868
self.args = args
6969
self.request_in_process = False
7070
self.prompt = args.prefix
71-
72-
# MLX server uses /v1/chat/completions endpoint
73-
if getattr(args, "runtime", None) == "mlx":
74-
self.url = f"{args.url}/v1/chat/completions"
75-
else:
76-
self.url = f"{args.url}/chat/completions"
71+
self.url = f"{args.url}/chat/completions"
7772
self.prep_rag_message()
7873

7974
def prep_rag_message(self):

ramalama/model.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import sys
1010
import threading
1111
import time
12+
from typing import Optional
1213

1314
import ramalama.chat as chat
1415
from ramalama.common import (
@@ -118,7 +119,7 @@ def __init__(self, model, model_store_path):
118119
self._model_type = type(self).__name__.lower()
119120

120121
self._model_store_path: str = model_store_path
121-
self._model_store: ModelStore | None = None
122+
self._model_store: Optional[ModelStore] = None
122123

123124
self.default_image = accel_image(CONFIG)
124125

@@ -443,10 +444,10 @@ def _build_mlx_exec_args(self, subcommand: str, model_path: str, args, extra: li
443444
shlex.quote(model_path),
444445
]
445446

446-
if getattr(args, "temp", None) is not None:
447+
if getattr(args, "temp", None):
447448
exec_args += ["--temp", str(args.temp)]
448449

449-
if getattr(args, "seed", None) is not None:
450+
if getattr(args, "seed", None):
450451
exec_args += ["--seed", str(args.seed)]
451452

452453
if getattr(args, "context", None):
@@ -476,12 +477,12 @@ def _mlx_generate_response(self, model_path, prompt, args, *, return_response=Fa
476477
from ramalama.engine import dry_run
477478

478479
dry_run(exec_args)
479-
return None if return_response else None
480+
return
480481

481482
# For single-prompt mode, use exec_cmd
482483
if not return_response:
483484
exec_cmd(exec_args, stdout2null=False)
484-
return None
485+
return
485486

486487
# For interactive mode, we need to capture the response
487488
# Consume stderr concurrently to avoid deadlocks if its buffer fills.

0 commit comments

Comments
 (0)