NiuTrans/LMT-60-sft-data
Preview • Updated • 693 • 5
How to use wzqww23/LMT-60-8B-mlx-8Bit with Transformers:
# Use a pipeline as a high-level helper
# Warning: Pipeline type "translation" is no longer supported in transformers v5.
# You must load the model directly (see below) or downgrade to v4.x with:
# 'pip install "transformers<5.0.0'
from transformers import pipeline
pipe = pipeline("translation", model="wzqww23/LMT-60-8B-mlx-8Bit") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("wzqww23/LMT-60-8B-mlx-8Bit")
model = AutoModelForCausalLM.from_pretrained("wzqww23/LMT-60-8B-mlx-8Bit")How to use wzqww23/LMT-60-8B-mlx-8Bit with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir LMT-60-8B-mlx-8Bit wzqww23/LMT-60-8B-mlx-8Bit
The Model wzqww23/LMT-60-8B-mlx-8Bit was converted to MLX format from NiuTrans/LMT-60-8B using mlx-lm version 0.28.3.
pip install mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("wzqww23/LMT-60-8B-mlx-8Bit")
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)
8-bit