Views
No views yet
mlx-community/Llama-3.2-3B-Instruct-4bitmlx-lm.pip install mlx-lm1from mlx_lm import load, generate
2
3# Load the model and your adapters
4model, tokenizer = load(
5 "mlx-community/Llama-3.2-3B-Instruct-4bit",
6 adapter_path="meetmerchant/tech-tweet-generator-llama3"
7)
8
9abstract = """
10[Paste Abstract Here]
11"""
12
13prompt = f"""
14<|begin_of_text|><|start_header_id|>system<|end_header_id|>
15You are a viral science communicator.
16<|eot_id|><|start_header_id|>user<|end_header_id|>
17Title: Example Paper
18Abstract:
19{abstract}
20<|eot_id|><|start_header_id|>assistant<|end_header_id|>
21"""
22
23response = generate(model, tokenizer, prompt=prompt, max_tokens=500)
24print(response)