Text Generation
PEFT
PyTorch
TensorBoard
Safetensors
Transformers
mixtral
axolotl
Generated from Trainer
alpaca
nous_hermes
lora
qlora
adapter
finetune
conversational
text-generation-inference
Instructions to use MaziyarPanahi/Nous-Hermes-2-Mixtral-8x7B-SFT-Alpaca with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use MaziyarPanahi/Nous-Hermes-2-Mixtral-8x7B-SFT-Alpaca with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("NousResearch/Nous-Hermes-2-Mixtral-8x7B-SFT") model = PeftModel.from_pretrained(base_model, "MaziyarPanahi/Nous-Hermes-2-Mixtral-8x7B-SFT-Alpaca") - Transformers
How to use MaziyarPanahi/Nous-Hermes-2-Mixtral-8x7B-SFT-Alpaca with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MaziyarPanahi/Nous-Hermes-2-Mixtral-8x7B-SFT-Alpaca") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MaziyarPanahi/Nous-Hermes-2-Mixtral-8x7B-SFT-Alpaca") model = AutoModelForCausalLM.from_pretrained("MaziyarPanahi/Nous-Hermes-2-Mixtral-8x7B-SFT-Alpaca", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MaziyarPanahi/Nous-Hermes-2-Mixtral-8x7B-SFT-Alpaca with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MaziyarPanahi/Nous-Hermes-2-Mixtral-8x7B-SFT-Alpaca" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MaziyarPanahi/Nous-Hermes-2-Mixtral-8x7B-SFT-Alpaca", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MaziyarPanahi/Nous-Hermes-2-Mixtral-8x7B-SFT-Alpaca
- SGLang
How to use MaziyarPanahi/Nous-Hermes-2-Mixtral-8x7B-SFT-Alpaca 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 "MaziyarPanahi/Nous-Hermes-2-Mixtral-8x7B-SFT-Alpaca" \ --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": "MaziyarPanahi/Nous-Hermes-2-Mixtral-8x7B-SFT-Alpaca", "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 "MaziyarPanahi/Nous-Hermes-2-Mixtral-8x7B-SFT-Alpaca" \ --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": "MaziyarPanahi/Nous-Hermes-2-Mixtral-8x7B-SFT-Alpaca", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use MaziyarPanahi/Nous-Hermes-2-Mixtral-8x7B-SFT-Alpaca with Docker Model Runner:
docker model run hf.co/MaziyarPanahi/Nous-Hermes-2-Mixtral-8x7B-SFT-Alpaca
Download pytorch_model-00012-of-00019.bin from MaziyarPanahi/Nous-Hermes-2-Mixtral-8x7B-SFT-Alpaca: direct link, hf CLI and curl.
- Browser
- Download file 4.98 GB
-
https://huggingface.co/MaziyarPanahi/Nous-Hermes-2-Mixtral-8x7B-SFT-Alpaca/resolve/main/pytorch_model-00012-of-00019.bin
- Command line
-
hf download hf://MaziyarPanahi/Nous-Hermes-2-Mixtral-8x7B-SFT-Alpaca/pytorch_model-00012-of-00019.bin
-
curl -L -o pytorch_model-00012-of-00019.bin https://huggingface.co/MaziyarPanahi/Nous-Hermes-2-Mixtral-8x7B-SFT-Alpaca/resolve/main/pytorch_model-00012-of-00019.bin
4.98 GB
- Xet hash:
- 40a7d19c0963fe61522e27ee91f59a1be9852309112e62bfb0b98b26dbb2b77e
- Size of remote file:
- 4.98 GB
- SHA256:
- 3f9b5c320b508d0ec6801e931ae85303025297223fc3dfe908c4573b5f747d49
·
Xet efficiently stores Large Files inside Git, intelligently splitting files into unique chunks and accelerating uploads and downloads. More info.