CyberNative/Code_Vulnerability_Security_DPO
Viewer • Updated • 4.66k • 5.19k • 159
How to use beezu/zerofata_MS3.2-PaintedFantasy-v4-24B-MLX-4Bit with MLX:
# Make sure mlx-lm is installed
# pip install --upgrade mlx-lm
# Generate text with mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("beezu/zerofata_MS3.2-PaintedFantasy-v4-24B-MLX-4Bit")
prompt = "Write a story about Einstein"
messages = [{"role": "user", "content": prompt}]
prompt = tokenizer.apply_chat_template(
messages, add_generation_prompt=True
)
text = generate(model, tokenizer, prompt=prompt, verbose=True)How to use beezu/zerofata_MS3.2-PaintedFantasy-v4-24B-MLX-4Bit with MLX LM:
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "beezu/zerofata_MS3.2-PaintedFantasy-v4-24B-MLX-4Bit"
# Install MLX LM
uv tool install mlx-lm
# Start the server
mlx_lm.server --model "beezu/zerofata_MS3.2-PaintedFantasy-v4-24B-MLX-4Bit"
# Calling the OpenAI-compatible server with curl
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "beezu/zerofata_MS3.2-PaintedFantasy-v4-24B-MLX-4Bit",
"messages": [
{"role": "user", "content": "Hello"}
]
}'This model beezu/zerofata_MS3.2-PaintedFantasy-v4-24B-MLX-4Bit was converted to MLX format from zerofata/MS3.2-PaintedFantasy-v4-24B using mlx-lm version 0.30.6.
pip install mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("beezu/zerofata_MS3.2-PaintedFantasy-v4-24B-MLX-4Bit")
prompt = "hello"
if tokenizer.chat_template is not None:
messages = [{"role": "user", "content": prompt}]
prompt = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, return_dict=False,
)
response = generate(model, tokenizer, prompt=prompt, verbose=True)
4-bit
Base model
mistralai/Mistral-Small-3.1-24B-Base-2503