Update README.md
Browse files
README.md
CHANGED
|
@@ -35,10 +35,10 @@ Fine-tuning started from the **instruct checkpoint** rather than base. Testing c
|
|
| 35 |
- **Base model:** `LiquidAI/LFM2.5-350M` (instruct)
|
| 36 |
- **Method:** Full fine-tune (96GB VRAM, no LoRA needed)
|
| 37 |
- **Datasets:**
|
| 38 |
-
- Python Code: `iamtarun/python_code_instructions_18k_alpaca` (Python-focused, replacing the multi-language 120k set)
|
| 39 |
-
- Math: `openai/gsm8k` (main split)
|
| 40 |
-
- General Chat: `yahma/alpaca-cleaned` (30k sample subset)
|
| 41 |
-
- Custom Fix-It: Hand-crafted examples for negative constraints ("no dairy", "no eggs") and complete runnable Pygame scripts (duplicated
|
| 42 |
- **Checkpoint selection:** Best by eval_loss
|
| 43 |
- **Sequence length:** 2048 tokens (increased from 1024 to accommodate full scripts)
|
| 44 |
- **Max response chars:** 3500 (prevents code truncation)
|
|
@@ -48,21 +48,22 @@ Fine-tuning started from the **instruct checkpoint** rather than base. Testing c
|
|
| 48 |
|
| 49 |
## What it's good at
|
| 50 |
|
| 51 |
-
- **Python Code
|
| 52 |
-
- **Math
|
| 53 |
-
- **General Chat
|
| 54 |
-
- **Speed
|
| 55 |
|
| 56 |
## Known limitations
|
| 57 |
|
| 58 |
-
- **Python only
|
| 59 |
-
- **Sentence counting
|
| 60 |
-
- **Identity
|
| 61 |
-
- **Still 350M parameters
|
| 62 |
- Not evaluated on safety-critical, medical, or legal use cases.
|
| 63 |
|
| 64 |
## Usage
|
| 65 |
|
|
|
|
| 66 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 67 |
|
| 68 |
model_id = "hauser458original/lfm2.5-350m-python-math"
|
|
@@ -76,8 +77,9 @@ inputs = tokenizer.apply_chat_template(
|
|
| 76 |
|
| 77 |
output = model.generate(**inputs, max_new_tokens=512, do_sample=True, temperature=0.5, top_p=0.9)
|
| 78 |
print(tokenizer.decode(output[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
|
|
|
|
| 79 |
|
| 80 |
-
GGUF quantized versions (Q4_K_M, Q5_K_S, Q5_K_M, Q8_0, F16) for llama.cpp/Ollama/LM Studio are available at: hauser458original/lfm2.5-350m-python-math-GGUF
|
| 81 |
|
| 82 |
## License
|
| 83 |
|
|
|
|
| 35 |
- **Base model:** `LiquidAI/LFM2.5-350M` (instruct)
|
| 36 |
- **Method:** Full fine-tune (96GB VRAM, no LoRA needed)
|
| 37 |
- **Datasets:**
|
| 38 |
+
- Python Code: [`iamtarun/python_code_instructions_18k_alpaca`](https://huggingface.co/datasets/iamtarun/python_code_instructions_18k_alpaca) (Python-focused, replacing the multi-language 120k set)
|
| 39 |
+
- Math: [`openai/gsm8k`](https://huggingface.co/datasets/openai/gsm8k) (main split)
|
| 40 |
+
- General Chat: [`yahma/alpaca-cleaned`](https://huggingface.co/datasets/yahma/alpaca-cleaned) (30k sample subset)
|
| 41 |
+
- Custom Fix-It: Hand-crafted examples for negative constraints ("no dairy", "no eggs") and complete runnable Pygame scripts (duplicated 50x for weight)
|
| 42 |
- **Checkpoint selection:** Best by eval_loss
|
| 43 |
- **Sequence length:** 2048 tokens (increased from 1024 to accommodate full scripts)
|
| 44 |
- **Max response chars:** 3500 (prevents code truncation)
|
|
|
|
| 48 |
|
| 49 |
## What it's good at
|
| 50 |
|
| 51 |
+
- **Python Code**: Complete, runnable scripts including Pygame game loops, file I/O, classes, list comprehensions, and algorithmic implementations (e.g., two-pointer palindrome check). No more placeholder `pass` statements or truncated functions.
|
| 52 |
+
- **Math**: GSM8K-style word problems with step-by-step reasoning annotations (`<<...>>`). Reliable on algebra, percentages, geometry, and multi-step arithmetic.
|
| 53 |
+
- **General Chat**: Retains coherent conversational ability. Correctly handles negative constraints (e.g., "breakfast without eggs" returns egg-free options). Knows the difference between baking cookies and browser cookies.
|
| 54 |
+
- **Speed**: At 350M parameters, achieves ~157 t/s generation on laptop CPU (i5-12450H) with Q5_K_S quantization via llama.cpp.
|
| 55 |
|
| 56 |
## Known limitations
|
| 57 |
|
| 58 |
+
- **Python only**: Trained exclusively on Python code instructions. Other languages were not included in this fine-tune.
|
| 59 |
+
- **Sentence counting**: May not strictly adhere to "exactly N sentences" constraints.
|
| 60 |
+
- **Identity**: May occasionally claim to be developed by Google (artifact from Alpaca-Cleaned training data).
|
| 61 |
+
- **Still 350M parameters**: Do not expect deep multi-step reasoning or long-form creative writing at the level of larger models.
|
| 62 |
- Not evaluated on safety-critical, medical, or legal use cases.
|
| 63 |
|
| 64 |
## Usage
|
| 65 |
|
| 66 |
+
```python
|
| 67 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 68 |
|
| 69 |
model_id = "hauser458original/lfm2.5-350m-python-math"
|
|
|
|
| 77 |
|
| 78 |
output = model.generate(**inputs, max_new_tokens=512, do_sample=True, temperature=0.5, top_p=0.9)
|
| 79 |
print(tokenizer.decode(output[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
|
| 80 |
+
```
|
| 81 |
|
| 82 |
+
GGUF quantized versions (Q4_K_M, Q5_K_S, Q5_K_M, Q8_0, F16) for llama.cpp/Ollama/LM Studio are available at: [`hauser458original/lfm2.5-350m-python-math-GGUF`](https://huggingface.co/hauser458original/lfm2.5-350m-python-math-GGUF)
|
| 83 |
|
| 84 |
## License
|
| 85 |
|