Instructions to use Zyphra/Zamba2-2.7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Zyphra/Zamba2-2.7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Zyphra/Zamba2-2.7B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Zyphra/Zamba2-2.7B") model = AutoModelForCausalLM.from_pretrained("Zyphra/Zamba2-2.7B") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Zyphra/Zamba2-2.7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Zyphra/Zamba2-2.7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Zyphra/Zamba2-2.7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Zyphra/Zamba2-2.7B
- SGLang
How to use Zyphra/Zamba2-2.7B 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 "Zyphra/Zamba2-2.7B" \ --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": "Zyphra/Zamba2-2.7B", "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 "Zyphra/Zamba2-2.7B" \ --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": "Zyphra/Zamba2-2.7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Zyphra/Zamba2-2.7B with Docker Model Runner:
docker model run hf.co/Zyphra/Zamba2-2.7B
Was the new PHI-2.7B used in the Comparison?
I'm wondering, whether in the comparison the new or the old Phi-2.7b was used, considering that it was updated quite silently without a new version number.
We used the phi2-2.7B from Microsoft's HF repo: https://huggingface.co/microsoft/phi-2/tree/main
I see that those model weights were updated ~7 months ago, so I'm certain we used their latest version for evals.
If your question is about comparing evals to phi3-3.8B at https://huggingface.co/microsoft/Phi-3-mini-128k-instruct, we didn't compare because our model is base and theirs is instruct-tuned. If Microsoft releases the base model for phi3-3.8B we'll be happy to compare. Otherwise that comparison will have to wait until we release our instruct-tuned zamba2.