Instructions to use ethicalabs/xLSTM-7b-Polymath with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ethicalabs/xLSTM-7b-Polymath with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ethicalabs/xLSTM-7b-Polymath") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ethicalabs/xLSTM-7b-Polymath") model = AutoModelForCausalLM.from_pretrained("ethicalabs/xLSTM-7b-Polymath", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ethicalabs/xLSTM-7b-Polymath with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ethicalabs/xLSTM-7b-Polymath" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ethicalabs/xLSTM-7b-Polymath", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ethicalabs/xLSTM-7b-Polymath
- SGLang
How to use ethicalabs/xLSTM-7b-Polymath with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "ethicalabs/xLSTM-7b-Polymath" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ethicalabs/xLSTM-7b-Polymath", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "ethicalabs/xLSTM-7b-Polymath" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ethicalabs/xLSTM-7b-Polymath", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ethicalabs/xLSTM-7b-Polymath with Docker Model Runner:
docker model run hf.co/ethicalabs/xLSTM-7b-Polymath
Update README.md
Browse files
README.md
CHANGED
|
@@ -12,19 +12,19 @@ pipeline_tag: text-generation
|
|
| 12 |
|
| 13 |
# Model Card for xlstm-7b-instruct-phase-2
|
| 14 |
|
| 15 |
-
This model is a fine-tuned version of [ethicalabs/xLSTM-7b-Instruct](https://huggingface.co/ethicalabs/xLSTM-7b-Instruct).
|
| 16 |
-
It has been trained using [TRL](https://github.com/huggingface/trl).
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
-
```
|
| 21 |
-
|
|
|
|
| 22 |
|
| 23 |
-
|
| 24 |
-
generator = pipeline("text-generation", model="None", device="cuda")
|
| 25 |
-
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
|
| 26 |
-
print(output["generated_text"])
|
| 27 |
-
```
|
| 28 |
|
| 29 |
## Training procedure
|
| 30 |
|
|
|
|
| 12 |
|
| 13 |
# Model Card for xlstm-7b-instruct-phase-2
|
| 14 |
|
| 15 |
+
This model is a fine-tuned version of [ethicalabs/xLSTM-7b-Instruct](https://huggingface.co/ethicalabs/xLSTM-7b-Instruct) for task alignment.
|
|
|
|
| 16 |
|
| 17 |
+
It has been trained using [TRL](https://github.com/huggingface/trl) using SFT on assistant-only tokens.
|
| 18 |
+
|
| 19 |
+
The `k_proj` and `v_proj` matrices have been frozen to isolate and preserve the model's pre-trained knowledge base.
|
| 20 |
+
|
| 21 |
+
This fine-tuning focused only on the `q_proj` (query) and FFN matrices, adapting the model's reasoning and query-retrieval mechanisms without overwriting its core, frozen knowledge.
|
| 22 |
|
| 23 |
+
This experiment was designed to test the hypothesis that the model's reasoning capabilities (`q_proj`) could be specialized for math/code while its knowledge (`k_proj`, `v_proj`) remained intact.
|
| 24 |
+
|
| 25 |
+
## Quick start
|
| 26 |
|
| 27 |
+
Work in Progress!
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
## Training procedure
|
| 30 |
|