From 6b224fee0ca898a9ab884bf05efce83a4ed0c99b Mon Sep 17 00:00:00 2001 From: Derek Lewis <7467911+derekelewis@users.noreply.github.com> Date: Mon, 20 May 2024 10:11:32 -0500 Subject: [PATCH] Add llama3 8B instruct model configuration and prompt (#75) * Add model configuration for Llama 3 8B instruct model w/ prompt * Correct typo in model configuration name --- Libraries/LLM/Models.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Libraries/LLM/Models.swift b/Libraries/LLM/Models.swift index 917d59f..57573b0 100644 --- a/Libraries/LLM/Models.swift +++ b/Libraries/LLM/Models.swift @@ -143,6 +143,13 @@ extension ModelConfiguration { "\(prompt)" } + public static let llama38B4bit = ModelConfiguration( + id: "mlx-community/Meta-Llama-3-8B-Instruct-4bit" + ) { + prompt in + "<|begin_of_text|><|start_header_id|>system<|end_header_id|>\nYou are a helpful assistant<|eot_id|>\n<|start_header_id|>user<|end_header_id|>\n\(prompt)<|eot_id|>\n<|start_header_id|>assistant<|end_header_id|>" + } + private enum BootstrapState { case idle case bootstrapping