Instructions to use MohammadOthman/Mistral-NeuralHermes-Merge-7B-slerp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MohammadOthman/Mistral-NeuralHermes-Merge-7B-slerp with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MohammadOthman/Mistral-NeuralHermes-Merge-7B-slerp")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MohammadOthman/Mistral-NeuralHermes-Merge-7B-slerp") model = AutoModelForCausalLM.from_pretrained("MohammadOthman/Mistral-NeuralHermes-Merge-7B-slerp") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use MohammadOthman/Mistral-NeuralHermes-Merge-7B-slerp with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MohammadOthman/Mistral-NeuralHermes-Merge-7B-slerp" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MohammadOthman/Mistral-NeuralHermes-Merge-7B-slerp", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MohammadOthman/Mistral-NeuralHermes-Merge-7B-slerp
- SGLang
How to use MohammadOthman/Mistral-NeuralHermes-Merge-7B-slerp 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 "MohammadOthman/Mistral-NeuralHermes-Merge-7B-slerp" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MohammadOthman/Mistral-NeuralHermes-Merge-7B-slerp", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "MohammadOthman/Mistral-NeuralHermes-Merge-7B-slerp" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MohammadOthman/Mistral-NeuralHermes-Merge-7B-slerp", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use MohammadOthman/Mistral-NeuralHermes-Merge-7B-slerp with Docker Model Runner:
docker model run hf.co/MohammadOthman/Mistral-NeuralHermes-Merge-7B-slerp
Mistral-NeuralHermes-Merge-7B-slerp
Model Description
The Mistral-Merge-7B-slerp is a merged model which leverages the spherical linear interpolation (SLERP) technique to blend layers from two distinct transformer-based models. This merging strategy is aimed at synthesizing a model that incorporates the robust linguistic capabilities of OpenPipe/mistral-ft-optimized-1218 and the nuanced understanding of mlabonne/NeuralHermes-2.5-Mistral-7B.
Configuration
The merging process was configured to apply a SLERP method across all comparable layers of the two source models. Below is the YAML configuration used for merging:
slices:
- sources:
- model: OpenPipe/mistral-ft-optimized-1218
layer_range: [0, 32]
- model: mlabonne/NeuralHermes-2.5-Mistral-7B
layer_range: [0, 32]
merge_method: slerp
base_model: OpenPipe/mistral-ft-optimized-1218
parameters:
t:
- filter: self_attn
value: [0, 0.5, 0.3, 0.7, 1]
- filter: mlp
value: [1, 0.5, 0.7, 0.3, 0]
- value: 0.5
dtype: bfloat16
This configuration ensures that both self-attention and MLP (multi-layer perceptron) layers undergo interpolation with a gradient of weights to optimize the integration of features from both models.
- Downloads last month
- 18