This model
staedi/coref-llama-3.2 was
converted to MLX format from
meta-llama/llama-3.2-3B-Instruct
using mlx-lm version
0.26.2.
1from mlx_lm import load, generate
2# Load model with adapter
3model, tokenizer = load("staedi/coref-llama-3.2")
4# Text to resolve coreferences in
5text = "Apple announced its earnings. The company performed well."
6# Create prompt
7prompt = (
8 "Resolve all coreferences in the following text by replacing pronouns and "
9 "descriptive references with their original entities. Maintain the same "
10 "meaning and structure while making all references explicit: \n " + text
11)
12if tokenizer.chat_template is not None:
13 messages = [{'role':'user','content':prompt}]
14 prompt = tokenizer.apply_chat_template(
15 messages, add_generation_prompt=True
16 )
17response = generate(model, tokenizer, prompt=prompt, verbose=True)