Instructions to use ShahriarFerdoush/llama-3.2-1b-code-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ShahriarFerdoush/llama-3.2-1b-code-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ShahriarFerdoush/llama-3.2-1b-code-instruct")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ShahriarFerdoush/llama-3.2-1b-code-instruct") model = AutoModelForCausalLM.from_pretrained("ShahriarFerdoush/llama-3.2-1b-code-instruct") - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ShahriarFerdoush/llama-3.2-1b-code-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ShahriarFerdoush/llama-3.2-1b-code-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ShahriarFerdoush/llama-3.2-1b-code-instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ShahriarFerdoush/llama-3.2-1b-code-instruct
- SGLang
How to use ShahriarFerdoush/llama-3.2-1b-code-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 "ShahriarFerdoush/llama-3.2-1b-code-instruct" \ --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": "ShahriarFerdoush/llama-3.2-1b-code-instruct", "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 "ShahriarFerdoush/llama-3.2-1b-code-instruct" \ --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": "ShahriarFerdoush/llama-3.2-1b-code-instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ShahriarFerdoush/llama-3.2-1b-code-instruct with Docker Model Runner:
docker model run hf.co/ShahriarFerdoush/llama-3.2-1b-code-instruct
Fine-tuned Llama 3.2-1B for code generation
Browse files- config.json +1 -16
- model.safetensors +2 -2
config.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
"bos_token_id": 128000,
|
| 8 |
-
"dtype": "
|
| 9 |
"eos_token_id": 128001,
|
| 10 |
"head_dim": 64,
|
| 11 |
"hidden_act": "silu",
|
|
@@ -19,21 +19,6 @@
|
|
| 19 |
"num_hidden_layers": 16,
|
| 20 |
"num_key_value_heads": 8,
|
| 21 |
"pretraining_tp": 1,
|
| 22 |
-
"quantization_config": {
|
| 23 |
-
"_load_in_4bit": true,
|
| 24 |
-
"_load_in_8bit": false,
|
| 25 |
-
"bnb_4bit_compute_dtype": "float16",
|
| 26 |
-
"bnb_4bit_quant_storage": "uint8",
|
| 27 |
-
"bnb_4bit_quant_type": "nf4",
|
| 28 |
-
"bnb_4bit_use_double_quant": true,
|
| 29 |
-
"llm_int8_enable_fp32_cpu_offload": false,
|
| 30 |
-
"llm_int8_has_fp16_weight": false,
|
| 31 |
-
"llm_int8_skip_modules": null,
|
| 32 |
-
"llm_int8_threshold": 6.0,
|
| 33 |
-
"load_in_4bit": true,
|
| 34 |
-
"load_in_8bit": false,
|
| 35 |
-
"quant_method": "bitsandbytes"
|
| 36 |
-
},
|
| 37 |
"rms_norm_eps": 1e-05,
|
| 38 |
"rope_scaling": {
|
| 39 |
"factor": 8.0,
|
|
|
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
"bos_token_id": 128000,
|
| 8 |
+
"dtype": "float16",
|
| 9 |
"eos_token_id": 128001,
|
| 10 |
"head_dim": 64,
|
| 11 |
"hidden_act": "silu",
|
|
|
|
| 19 |
"num_hidden_layers": 16,
|
| 20 |
"num_key_value_heads": 8,
|
| 21 |
"pretraining_tp": 1,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
"rms_norm_eps": 1e-05,
|
| 23 |
"rope_scaling": {
|
| 24 |
"factor": 8.0,
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b492fe3ea0f116adbecf54030db2d8f29f182ad607c0a381f5b0d123041f601c
|
| 3 |
+
size 2471645464
|