Text Generation
Transformers
Safetensors
English
French
Arabic
mistral
mergekit
Merge
conversational
text-generation-inference
Instructions to use ayoubkirouane/Mistral-SLERP-Merged7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ayoubkirouane/Mistral-SLERP-Merged7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ayoubkirouane/Mistral-SLERP-Merged7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("ayoubkirouane/Mistral-SLERP-Merged7B") model = AutoModelForMultimodalLM.from_pretrained("ayoubkirouane/Mistral-SLERP-Merged7B") 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 ayoubkirouane/Mistral-SLERP-Merged7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ayoubkirouane/Mistral-SLERP-Merged7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ayoubkirouane/Mistral-SLERP-Merged7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ayoubkirouane/Mistral-SLERP-Merged7B
- SGLang
How to use ayoubkirouane/Mistral-SLERP-Merged7B 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 "ayoubkirouane/Mistral-SLERP-Merged7B" \ --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": "ayoubkirouane/Mistral-SLERP-Merged7B", "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 "ayoubkirouane/Mistral-SLERP-Merged7B" \ --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": "ayoubkirouane/Mistral-SLERP-Merged7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ayoubkirouane/Mistral-SLERP-Merged7B with Docker Model Runner:
docker model run hf.co/ayoubkirouane/Mistral-SLERP-Merged7B
Update README.md
Browse files
README.md
CHANGED
|
@@ -7,10 +7,6 @@ tags:
|
|
| 7 |
- merge
|
| 8 |
|
| 9 |
---
|
| 10 |
-
# merge
|
| 11 |
-
|
| 12 |
-
This is a merge of pre-trained language models created using [mergekit](https://github.com/cg123/mergekit).
|
| 13 |
-
|
| 14 |
## Merge Details
|
| 15 |
### Merge Method
|
| 16 |
|
|
@@ -65,4 +61,26 @@ from transformers import AutoTokenizer, AutoModelForCausalLM
|
|
| 65 |
tokenizer = AutoTokenizer.from_pretrained("ayoubkirouane/Mistral-Merged7B")
|
| 66 |
model = AutoModelForCausalLM.from_pretrained("ayoubkirouane/Mistral-Merged7B")
|
| 67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
```
|
|
|
|
| 7 |
- merge
|
| 8 |
|
| 9 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
## Merge Details
|
| 11 |
### Merge Method
|
| 12 |
|
|
|
|
| 61 |
tokenizer = AutoTokenizer.from_pretrained("ayoubkirouane/Mistral-Merged7B")
|
| 62 |
model = AutoModelForCausalLM.from_pretrained("ayoubkirouane/Mistral-Merged7B")
|
| 63 |
|
| 64 |
+
# 4 bit :
|
| 65 |
+
|
| 66 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
|
| 67 |
+
import torch
|
| 68 |
+
|
| 69 |
+
nf4_config = BitsAndBytesConfig(
|
| 70 |
+
load_in_4bit=True,
|
| 71 |
+
bnb_4bit_quant_type="nf4",
|
| 72 |
+
bnb_4bit_use_double_quant=True,
|
| 73 |
+
bnb_4bit_compute_dtype=torch.bfloat16
|
| 74 |
+
)
|
| 75 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 76 |
+
"ayoubkirouane/Mistral-SLERP-Merged7B",
|
| 77 |
+
device_map='auto',
|
| 78 |
+
quantization_config=nf4_config,
|
| 79 |
+
use_cache=False
|
| 80 |
+
)
|
| 81 |
+
tokenizer = AutoTokenizer.from_pretrained("ayoubkirouane/Mistral-SLERP-Merged7B")
|
| 82 |
+
|
| 83 |
+
tokenizer.pad_token = tokenizer.eos_token
|
| 84 |
+
tokenizer.padding_side = "right"
|
| 85 |
+
|
| 86 |
```
|