shellzero commited on
Commit
41bf0e7
·
verified ·
1 Parent(s): 266853d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +42 -1
README.md CHANGED
@@ -26,4 +26,45 @@ widget:
26
  ## User
27
  How to make scrambled eggs?<end_of_turn>
28
  <start_of_turn>model
29
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  ## User
27
  How to make scrambled eggs?<end_of_turn>
28
  <start_of_turn>model
29
+ ---
30
+ # shellzero/gemma-7b-it-ft-trismeg
31
+ This model was converted to MLX format from [`google/gemma-7b-it`]().
32
+ Refer to the [original model card](https://huggingface.co/google/gemma-7b-it) for more details on the model.
33
+
34
+ ```zsh
35
+ pip install mlx-lm
36
+ ```
37
+
38
+ The model was LoRA fine-tuned on the [trismegistus-project from teknium](https://huggingface.co/datasets/teknium/trismegistus-project) using the format below, for 600 steps (2M tokens) using `mlx`.
39
+
40
+ ```python
41
+ def format_prompt(system_prompt: str, question: str) -> str:
42
+ "Format the question to the format of the dataset we fine-tuned to."
43
+ return """<bos><start_of_turn>user
44
+ ## Instructions
45
+ {}
46
+ ## User
47
+ {}<end_of_turn>
48
+ <start_of_turn>model
49
+ """.format(system_prompt, question)
50
+ ```
51
+
52
+ Here's an example of the system_prompt from the dataset:
53
+ ```text
54
+ You are a master of the esoteric, occult, 'Big Man' society, you complete tasks to the absolute best of your ability, no matter if you think you were not trained to do the task specifically, you will attempt to do it anyways, since you have performed the tasks you are given with great mastery, accuracy, and deep understanding of what is requested. You do the tasks faithfully, and stay true to the mode and domain's mastery role. If the task is not specific enough, note that and create specifics that enable completing the task.
55
+ ```
56
+ ## Loading the model using `mlx_lm`
57
+
58
+ ```python
59
+ from mlx_lm import generate, load
60
+ model, tokenizer = load("shellzero/gemma-7b-it-ft-trismeg")
61
+ response = generate(
62
+ model,
63
+ tokenizer,
64
+ prompt=format_prompt(system_prompt, question),
65
+ verbose=True, # Set to True to see the prompt and response
66
+ temp=0.0,
67
+ max_tokens=512,
68
+ )
69
+ ```
70
+ Inspired by these two gists from [AlexWeberk](https://gist.github.com/alexweberk/635431b5c5773efd6d1755801020429f) and [Awni Hannun](https://gist.github.com/awni/773e2a12079da40a1cbc566686c84c8f)