mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-12-15 09:48:54 +08:00
[mlx-lm] Use top p in server (#1144)
* use top p in server * couple other fixes
This commit is contained in:
@@ -190,7 +190,7 @@ def make_repetition_penalty(penalty: float, context_size: int = 20):
|
||||
Callable[[mx.array, List[int]], mx.array]:
|
||||
The repetition penalty processor.
|
||||
"""
|
||||
if penalty < 0 or not isinstance(penalty, float):
|
||||
if penalty < 0 or not isinstance(penalty, (int, float)):
|
||||
raise ValueError(f"penalty must be a non-negative float, got {penalty}")
|
||||
|
||||
def repetition_penalty_processor(tokens, logits):
|
||||
|
||||
Reference in New Issue
Block a user