Update README.md
Browse files
README.md
CHANGED
|
@@ -1,17 +1,18 @@
|
|
| 1 |
---
|
| 2 |
base_model:
|
| 3 |
-
-
|
| 4 |
library_name: transformers
|
| 5 |
model_name: xlstm-7b-chatml
|
| 6 |
tags:
|
| 7 |
-
- base_model:adapter:
|
| 8 |
-
- lora
|
| 9 |
- sft
|
| 10 |
- transformers
|
| 11 |
- trl
|
| 12 |
licence: license
|
| 13 |
pipeline_tag: text-generation
|
| 14 |
license: mit
|
|
|
|
|
|
|
| 15 |
---
|
| 16 |
|
| 17 |
# Model Card for xLSTM-7b-Instruct
|
|
@@ -21,15 +22,56 @@ It has been trained using [TRL](https://github.com/huggingface/trl).
|
|
| 21 |
|
| 22 |
## Quick start
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
```python
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
```
|
| 27 |
|
| 28 |
## Training procedure
|
| 29 |
|
| 30 |
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="150" height="24"/>](https://wandb.ai/ethicalabs-ai/xlstm-finetuning/runs/pfmf34a3)
|
| 31 |
|
| 32 |
-
|
| 33 |
This model was trained with SFT.
|
| 34 |
|
| 35 |
### Framework versions
|
|
@@ -43,8 +85,6 @@ This model was trained with SFT.
|
|
| 43 |
|
| 44 |
## Citations
|
| 45 |
|
| 46 |
-
|
| 47 |
-
|
| 48 |
Cite TRL as:
|
| 49 |
|
| 50 |
```bibtex
|
|
|
|
| 1 |
---
|
| 2 |
base_model:
|
| 3 |
+
- NX-AI/xLSTM-7b
|
| 4 |
library_name: transformers
|
| 5 |
model_name: xlstm-7b-chatml
|
| 6 |
tags:
|
| 7 |
+
- base_model:adapter:ethicalabs/xLSTM-7b-Instruct-PEFT
|
|
|
|
| 8 |
- sft
|
| 9 |
- transformers
|
| 10 |
- trl
|
| 11 |
licence: license
|
| 12 |
pipeline_tag: text-generation
|
| 13 |
license: mit
|
| 14 |
+
datasets:
|
| 15 |
+
- HuggingFaceH4/ultrachat_200k
|
| 16 |
---
|
| 17 |
|
| 18 |
# Model Card for xLSTM-7b-Instruct
|
|
|
|
| 22 |
|
| 23 |
## Quick start
|
| 24 |
|
| 25 |
+
For text generation you have to to pin specific pytorch versions [https://huggingface.co/datasets/John6666/forum1/blob/main/xlstm_1.md](https://huggingface.co/datasets/John6666/forum1/blob/main/xlstm_1.md)
|
| 26 |
+
|
| 27 |
+
```shell
|
| 28 |
+
pip install "torch==2.5.1" "torchvision==0.20.1" "torchaudio==2.5.1" --index-url https://download.pytorch.org/whl/cu124
|
| 29 |
+
pip install "triton==3.4.0" # >=3.1 is OK; 3.4.0 current as of Sep 2025
|
| 30 |
+
pip install "mlstm-kernels==2.0.1" "xlstm==2.0.5"
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
```python
|
| 34 |
+
import torch
|
| 35 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, AutoConfig
|
| 36 |
+
|
| 37 |
+
MERGED_MODEL_PATH = "ethicalabs/xLSTM-7b-Instruct"
|
| 38 |
+
|
| 39 |
+
# We apply a configuration that uses native, hardware-agnostic kernels.
|
| 40 |
+
print("Defining a safe, native kernel configuration for compatibility...")
|
| 41 |
+
|
| 42 |
+
safe_config = AutoConfig.from_pretrained(MERGED_MODEL_PATH, trust_remote_code=True)
|
| 43 |
+
# Use the stable, native parallel kernel
|
| 44 |
+
safe_config.chunkwise_kernel = "chunkwise--native_autograd"
|
| 45 |
+
safe_config.sequence_kernel = "native_sequence__native"
|
| 46 |
+
safe_config.step_kernel = "native"
|
| 47 |
+
# This flag is still required for the HF implementation to avoid unpacking errors
|
| 48 |
+
safe_config.return_last_states = False
|
| 49 |
+
|
| 50 |
+
# Load the final, merged model with the safe config (no quantization)
|
| 51 |
+
print("Loading the final, merged model in bfloat16 (no quantization for compatibility)...")
|
| 52 |
+
final_model = AutoModelForCausalLM.from_pretrained(
|
| 53 |
+
MERGED_MODEL_PATH,
|
| 54 |
+
device_map="auto",
|
| 55 |
+
torch_dtype=torch.bfloat16,
|
| 56 |
+
trust_remote_code=True,
|
| 57 |
+
config=safe_config
|
| 58 |
+
)
|
| 59 |
+
final_tokenizer = AutoTokenizer.from_pretrained(MERGED_MODEL_PATH)
|
| 60 |
+
|
| 61 |
+
# The tokenizer needs to know which token to use for padding.
|
| 62 |
+
if final_tokenizer.pad_token is None:
|
| 63 |
+
final_tokenizer.pad_token = final_tokenizer.eos_token
|
| 64 |
+
print("Padding token has been set.")
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
# Set the model to evaluation mode
|
| 68 |
+
final_model.eval()
|
| 69 |
```
|
| 70 |
|
| 71 |
## Training procedure
|
| 72 |
|
| 73 |
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="150" height="24"/>](https://wandb.ai/ethicalabs-ai/xlstm-finetuning/runs/pfmf34a3)
|
| 74 |
|
|
|
|
| 75 |
This model was trained with SFT.
|
| 76 |
|
| 77 |
### Framework versions
|
|
|
|
| 85 |
|
| 86 |
## Citations
|
| 87 |
|
|
|
|
|
|
|
| 88 |
Cite TRL as:
|
| 89 |
|
| 90 |
```bibtex
|