ykhrustalev commited on
Commit
9b74e95
·
verified ·
1 Parent(s): 53303a3

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +23 -1
README.md CHANGED
@@ -48,6 +48,16 @@ MLX export of [LFM2.5-1.2B-Instruct](https://huggingface.co/LiquidAI/LFM2.5-1.2B
48
  | Size | 628 MB |
49
  | Context Length | 128K |
50
 
 
 
 
 
 
 
 
 
 
 
51
  ## Use with mlx
52
 
53
  ```bash
@@ -56,6 +66,7 @@ pip install mlx-lm
56
 
57
  ```python
58
  from mlx_lm import load, generate
 
59
 
60
  model, tokenizer = load("LiquidAI/LFM2.5-1.2B-Instruct-4bit")
61
 
@@ -67,7 +78,18 @@ if tokenizer.chat_template is not None:
67
  messages, tokenize=False, add_generation_prompt=True
68
  )
69
 
70
- response = generate(model, tokenizer, prompt=prompt, verbose=True)
 
 
 
 
 
 
 
 
 
 
 
71
  ```
72
 
73
  ## License
 
48
  | Size | 628 MB |
49
  | Context Length | 128K |
50
 
51
+ ## Recommended Sampling Parameters
52
+
53
+ | Parameter | Value |
54
+ |-----------|-------|
55
+ | temperature | 0.1 |
56
+ | top_k | 50 |
57
+ | top_p | 0.1 |
58
+ | repetition_penalty | 1.05 |
59
+ | max_tokens | 512 |
60
+
61
  ## Use with mlx
62
 
63
  ```bash
 
66
 
67
  ```python
68
  from mlx_lm import load, generate
69
+ from mlx_lm.sample_utils import make_sampler, make_logits_processors
70
 
71
  model, tokenizer = load("LiquidAI/LFM2.5-1.2B-Instruct-4bit")
72
 
 
78
  messages, tokenize=False, add_generation_prompt=True
79
  )
80
 
81
+ sampler = make_sampler(temp=0.1, top_k=50, top_p=0.1)
82
+ logits_processors = make_logits_processors(repetition_penalty=1.05)
83
+
84
+ response = generate(
85
+ model,
86
+ tokenizer,
87
+ prompt=prompt,
88
+ max_tokens=512,
89
+ sampler=sampler,
90
+ logits_processors=logits_processors,
91
+ verbose=True,
92
+ )
93
  ```
94
 
95
  ## License