cleanup: MLX valves

This commit is contained in:
Justin Hayes 2024-07-01 23:24:32 -04:00 committed by GitHub
parent c44fb71930
commit f7ac26be13
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,12 +20,12 @@ import psutil
class Pipeline: class Pipeline:
class Valves(BaseModel): class Valves(BaseModel):
MLX_STOP: str = "<|start_header_id|>,<|end_header_id|>,<|eot_id|>" MLX_MODEL_FILTER: str = "mlx-community"
HUGGINGFACE_TOKEN: str = ""
MLX_MODEL_PATTERN: str = "mlx-community"
MLX_DEFAULT_MODEL: str = "mlx-community/Meta-Llama-3-8B-Instruct-8bit" MLX_DEFAULT_MODEL: str = "mlx-community/Meta-Llama-3-8B-Instruct-8bit"
MLX_STOP: str = "<|start_header_id|>,<|end_header_id|>,<|eot_id|>"
MLX_CHAT_TEMPLATE: str = "" MLX_CHAT_TEMPLATE: str = ""
MLX_USE_DEFAULT_CHAT_TEMPLATE: bool = False MLX_USE_DEFAULT_CHAT_TEMPLATE: bool = False
HUGGINGFACE_TOKEN: str = ""
def __init__(self): def __init__(self):
# Pipeline identification # Pipeline identification
@ -61,7 +61,7 @@ class Pipeline:
cmd = [ cmd = [
'mlx_lm.manage', 'mlx_lm.manage',
'--scan', '--scan',
'--pattern', self.valves.MLX_MODEL_PATTERN, '--pattern', self.valves.MLX_MODEL_FILTER,
] ]
result = subprocess.run(cmd, capture_output=True, text=True) result = subprocess.run(cmd, capture_output=True, text=True)
lines = result.stdout.strip().split('\n') lines = result.stdout.strip().split('\n')