Instructions to use nyunai/nyun-c2-llama3-56B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nyunai/nyun-c2-llama3-56B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nyunai/nyun-c2-llama3-56B", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("nyunai/nyun-c2-llama3-56B", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("nyunai/nyun-c2-llama3-56B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use nyunai/nyun-c2-llama3-56B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nyunai/nyun-c2-llama3-56B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nyunai/nyun-c2-llama3-56B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/nyunai/nyun-c2-llama3-56B
- SGLang
How to use nyunai/nyun-c2-llama3-56B 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 "nyunai/nyun-c2-llama3-56B" \ --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": "nyunai/nyun-c2-llama3-56B", "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 "nyunai/nyun-c2-llama3-56B" \ --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": "nyunai/nyun-c2-llama3-56B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use nyunai/nyun-c2-llama3-56B with Docker Model Runner:
docker model run hf.co/nyunai/nyun-c2-llama3-56B
How to use from
SGLangUse 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 "nyunai/nyun-c2-llama3-56B" \
--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": "nyunai/nyun-c2-llama3-56B",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'Quick Links
๐น Key Highlights:
- 20% Fewer Parameters: nyun-c2-llama3-56B comprises approximately 20% fewer parameters than the popular Llama-3-70B.
- Better Performance: Despite having far fewer parameters, this model has better performance than Llama-3-70B.
- No Fine-Tuning Required: This model undergoes no fine-tuning, showcasing the raw potential of our optimization techniques.
Pipeline and Collaboration
For insights into the pipeline and the list of methods used to optimize these models, check out our PruneGPT repository (https://github.com/nyunAI/PruneGPT). We invite companies and organizations interested in joining forces with us to release more such open-source variants to reach out at contact@nyunai.com.
Model Performance
| Dataset | nyun-c2-llama3-56B | Meta-Llama3-70B | Meta-Llama2-70B | MBZUAI K2-65B |
|---|---|---|---|---|
| MMLU (5-shot) | 78.4 | 79.5 | 69.7 | 67.9 |
| Winogrande (5-shot) | 85.5 | 83.1 | 81.8 | 77.0 |
| BoolQ (0-shot) | 85.1 | 79.0 | 73.1 | 83.0 |
| Hellaswag (10-shot) | 86.9 | 88.0 | 86.9 | 85.5 |
| Arc Challenge (25-shot) | 66.0 | 68.8 | 67.2 | 64.8 |
| GSM8K (5-shot) | 76.8 | 76.9 | 52.6 | 50.2 |
| Average | 79.8 | 79.2 | 71.9 | 71.4 |
- Downloads last month
- 23
Install from pip and serve model
# Install SGLang from pip: pip install sglang# Start the SGLang server: python3 -m sglang.launch_server \ --model-path "nyunai/nyun-c2-llama3-56B" \ --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": "nyunai/nyun-c2-llama3-56B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'