Text Generation
Transformers
Safetensors
PyTorch
llama
facebook
meta
llama-3
conversational
text-generation-inference
Instructions to use fanherodev/Llama-3.2-3B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fanherodev/Llama-3.2-3B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="fanherodev/Llama-3.2-3B-Instruct") 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("fanherodev/Llama-3.2-3B-Instruct") model = AutoModelForCausalLM.from_pretrained("fanherodev/Llama-3.2-3B-Instruct", 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 fanherodev/Llama-3.2-3B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "fanherodev/Llama-3.2-3B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fanherodev/Llama-3.2-3B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/fanherodev/Llama-3.2-3B-Instruct
- SGLang
How to use fanherodev/Llama-3.2-3B-Instruct 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 "fanherodev/Llama-3.2-3B-Instruct" \ --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": "fanherodev/Llama-3.2-3B-Instruct", "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 "fanherodev/Llama-3.2-3B-Instruct" \ --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": "fanherodev/Llama-3.2-3B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use fanherodev/Llama-3.2-3B-Instruct with Docker Model Runner:
docker model run hf.co/fanherodev/Llama-3.2-3B-Instruct
Commit History
-
Update model card (#25)
Verified signature- Update model card (9a6331337414f948c323bd2abe59201eb27bb1c8) Co-authored-by: Pedro Cuenca <pcuenq@users.noreply.huggingface.co>0cb88a4
-
Update README.md
Verified signature392a143 -
Update chat template (#8)
Verified signature- Update chat template (45026b798cd537efe6a1abcb93040ad21d416c43)4e74cfc -
Fixes gate (#7)
Verified signature- Fixes gate (f894f2bb147e3bca93a96650829cfd4abba0a26b)7fb5250 -
Upload folder using huggingface_hub (#6)
Verified signature- Upload folder using huggingface_hub (531478f7f8e3d0b7a524edb8b00766b561685d54) Co-authored-by: Vaibhav Srivastav <reach-vb@users.noreply.huggingface.co>156bd01 -
Update README (#5)
Verified signature- Update README (2fdeb9796f759e97c10e5e71fb6ff02485fcc60f) Co-authored-by: Pedro Cuenca <pcuenq@users.noreply.huggingface.co>f287eb7 -
Update README.md (#4)
Verified signature- Update README.md (05b9d730df0928ded5b1c8abb841b1c9b70c9846) - Update README.md (11e7ba0e2a6a647c4541125159f4e8aa80fc427d) - Update README.md (955e00939b1732a8a611263ddc88b4f9625f4947) - Update README.md (c276b2eb5ac0e73b8c5d798bf8599d9e8aa8d9cd) - Update README.md (e36ba6b0edf3b08aaf72bc833468025b5a884ffc) Co-authored-by: Vaibhav Srivastav <reach-vb@users.noreply.huggingface.co>736597b
-
Update README.md
Verified signaturee5737c2 -
Update README.md
Verified signature5e63f9f -
Update config.json (#3)
Verified signature- Update config.json (03fe957311fce2ccbb79ae2f3cab1cdc8d11fe4a) Co-authored-by: Sanyam Bhutani <Sanyam@users.noreply.huggingface.co>f6dcb8a
-
Model card, license, AUP (#2)
Verified signature- Model card, license, AUP (0ce4853c92a553488ad0ac560f4c7dc4f33f55fc)276b29c
-
Upload folder using huggingface_hub
Verified signaturee6c23ae -
initial commit
Verified signaturee651fe4