AlekseyCalvin/Lyrical_MT_ru2en_SFT_v8_with_meter_solving
Viewer • Updated • 6.55k • 85 • 2
How to use AlekseyCalvin/Lyrical_Llama31_8B_ru2en_SFT-mlx-3Bit 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("AlekseyCalvin/Lyrical_Llama31_8B_ru2en_SFT-mlx-3Bit")
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 AlekseyCalvin/Lyrical_Llama31_8B_ru2en_SFT-mlx-3Bit with MLX LM:
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "AlekseyCalvin/Lyrical_Llama31_8B_ru2en_SFT-mlx-3Bit"
# Install MLX LM
uv tool install mlx-lm
# Start the server
mlx_lm.server --model "AlekseyCalvin/Lyrical_Llama31_8B_ru2en_SFT-mlx-3Bit"
# Calling the OpenAI-compatible server with curl
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "AlekseyCalvin/Lyrical_Llama31_8B_ru2en_SFT-mlx-3Bit",
"messages": [
{"role": "user", "content": "Hello"}
]
}'The Model AlekseyCalvin/Lyrical_Llama31_8B_ru2en_SFT-mlx-3Bit was converted to MLX format from AlekseyCalvin/Lyrical_Llama31_8B_ru2en_SFT using mlx-lm version 0.31.2.
pip install mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("AlekseyCalvin/Lyrical_Llama31_8B_ru2en_SFT-mlx-3Bit")
prompt="hello"
if hasattr(tokenizer, "apply_chat_template") and tokenizer.chat_template is not None:
messages = [{"role": "user", "content": prompt}]
prompt = tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
response = generate(model, tokenizer, prompt=prompt, verbose=True)
Fine-tuned over our custom bilingual translations dataset using a modified fork of AutoTrain.
By Aleksey Calvin Tsukanov & SilverAgePoets.com
3-bit
Base model
meta-llama/Llama-3.1-8B