Instructions to use jaydeepb/llama-3.2-1b-code-run2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jaydeepb/llama-3.2-1b-code-run2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jaydeepb/llama-3.2-1b-code-run2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("jaydeepb/llama-3.2-1b-code-run2") model = AutoModelForCausalLM.from_pretrained("jaydeepb/llama-3.2-1b-code-run2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use jaydeepb/llama-3.2-1b-code-run2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jaydeepb/llama-3.2-1b-code-run2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jaydeepb/llama-3.2-1b-code-run2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/jaydeepb/llama-3.2-1b-code-run2
- SGLang
How to use jaydeepb/llama-3.2-1b-code-run2 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 "jaydeepb/llama-3.2-1b-code-run2" \ --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": "jaydeepb/llama-3.2-1b-code-run2", "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 "jaydeepb/llama-3.2-1b-code-run2" \ --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": "jaydeepb/llama-3.2-1b-code-run2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use jaydeepb/llama-3.2-1b-code-run2 with Docker Model Runner:
docker model run hf.co/jaydeepb/llama-3.2-1b-code-run2
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 "jaydeepb/llama-3.2-1b-code-run2" \
--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": "jaydeepb/llama-3.2-1b-code-run2",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'llama-3.2-1b-code-run2
Llama-3.2-1B fine-tuned for one epoch on a 1M-sequence (128-token) sample of The Stack.
This is the Run 2 model from Predicting Memorization Before Fine-Tuning Language Models. It is fine-tuned on a separate 1M-sequence sample from the Run 1 model. We use it to test whether our classifier, trained on Run 1, predicts which sequences this model memorizes.
- Base model, meta-llama/Llama-3.2-1B
- Dataset, The Stack (bigcode/the-stack)
- Training, 1 epoch, sequence length 128, learning rate 5e-5, cosine schedule
License
Built with Llama. This model is a fine-tuned derivative of meta-llama/Llama-3.2-1B and is distributed under the Llama 3.2 Community License. Use of this model must comply with the Llama 3.2 Acceptable Use Policy.
Llama 3.2 is licensed under the Llama 3.2 Community License, Copyright © Meta Platforms, Inc. All Rights Reserved.
- Downloads last month
- 295
Model tree for jaydeepb/llama-3.2-1b-code-run2
Base model
meta-llama/Llama-3.2-1B
Install from pip and serve model
# Install SGLang from pip: pip install sglang# Start the SGLang server: python3 -m sglang.launch_server \ --model-path "jaydeepb/llama-3.2-1b-code-run2" \ --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": "jaydeepb/llama-3.2-1b-code-run2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'