Instructions to use AlignmentResearch/Llama-3.3-Tiny-Instruct-boolq with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AlignmentResearch/Llama-3.3-Tiny-Instruct-boolq with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AlignmentResearch/Llama-3.3-Tiny-Instruct-boolq") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("AlignmentResearch/Llama-3.3-Tiny-Instruct-boolq") model = AutoModelForCausalLM.from_pretrained("AlignmentResearch/Llama-3.3-Tiny-Instruct-boolq") 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use AlignmentResearch/Llama-3.3-Tiny-Instruct-boolq with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AlignmentResearch/Llama-3.3-Tiny-Instruct-boolq" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AlignmentResearch/Llama-3.3-Tiny-Instruct-boolq", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AlignmentResearch/Llama-3.3-Tiny-Instruct-boolq
- SGLang
How to use AlignmentResearch/Llama-3.3-Tiny-Instruct-boolq 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 "AlignmentResearch/Llama-3.3-Tiny-Instruct-boolq" \ --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": "AlignmentResearch/Llama-3.3-Tiny-Instruct-boolq", "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 "AlignmentResearch/Llama-3.3-Tiny-Instruct-boolq" \ --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": "AlignmentResearch/Llama-3.3-Tiny-Instruct-boolq", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use AlignmentResearch/Llama-3.3-Tiny-Instruct-boolq with Docker Model Runner:
docker model run hf.co/AlignmentResearch/Llama-3.3-Tiny-Instruct-boolq
Upload LlamaForCausalLM
Browse files- config.json +29 -13
- generation_config.json +6 -3
- model.safetensors +2 -2
config.json
CHANGED
|
@@ -4,27 +4,43 @@
|
|
| 4 |
],
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
-
"bos_token_id":
|
| 8 |
-
"eos_token_id":
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
"head_dim": 64,
|
| 10 |
"hidden_act": "silu",
|
| 11 |
-
"hidden_size":
|
|
|
|
|
|
|
|
|
|
| 12 |
"initializer_range": 0.02,
|
| 13 |
-
"intermediate_size":
|
| 14 |
-
"
|
|
|
|
|
|
|
|
|
|
| 15 |
"mlp_bias": false,
|
| 16 |
"model_type": "llama",
|
| 17 |
-
"num_attention_heads":
|
| 18 |
-
"num_hidden_layers":
|
| 19 |
-
"num_key_value_heads":
|
| 20 |
-
"pad_token_id":
|
| 21 |
"pretraining_tp": 1,
|
| 22 |
-
"rms_norm_eps": 1e-
|
| 23 |
-
"rope_scaling":
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
"tie_word_embeddings": false,
|
| 26 |
"torch_dtype": "bfloat16",
|
| 27 |
"transformers_version": "4.54.1",
|
| 28 |
"use_cache": true,
|
| 29 |
-
"vocab_size":
|
| 30 |
}
|
|
|
|
| 4 |
],
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 128000,
|
| 8 |
+
"eos_token_id": [
|
| 9 |
+
128001,
|
| 10 |
+
128008,
|
| 11 |
+
128009
|
| 12 |
+
],
|
| 13 |
"head_dim": 64,
|
| 14 |
"hidden_act": "silu",
|
| 15 |
+
"hidden_size": 256,
|
| 16 |
+
"id2label": {
|
| 17 |
+
"0": "LABEL_0"
|
| 18 |
+
},
|
| 19 |
"initializer_range": 0.02,
|
| 20 |
+
"intermediate_size": 768,
|
| 21 |
+
"label2id": {
|
| 22 |
+
"LABEL_0": 0
|
| 23 |
+
},
|
| 24 |
+
"max_position_embeddings": 131072,
|
| 25 |
"mlp_bias": false,
|
| 26 |
"model_type": "llama",
|
| 27 |
+
"num_attention_heads": 4,
|
| 28 |
+
"num_hidden_layers": 12,
|
| 29 |
+
"num_key_value_heads": 2,
|
| 30 |
+
"pad_token_id": 128004,
|
| 31 |
"pretraining_tp": 1,
|
| 32 |
+
"rms_norm_eps": 1e-05,
|
| 33 |
+
"rope_scaling": {
|
| 34 |
+
"factor": 8.0,
|
| 35 |
+
"high_freq_factor": 4.0,
|
| 36 |
+
"low_freq_factor": 1.0,
|
| 37 |
+
"original_max_position_embeddings": 8192,
|
| 38 |
+
"rope_type": "llama3"
|
| 39 |
+
},
|
| 40 |
+
"rope_theta": 500000.0,
|
| 41 |
"tie_word_embeddings": false,
|
| 42 |
"torch_dtype": "bfloat16",
|
| 43 |
"transformers_version": "4.54.1",
|
| 44 |
"use_cache": true,
|
| 45 |
+
"vocab_size": 128256
|
| 46 |
}
|
generation_config.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
-
"bos_token_id":
|
| 4 |
-
"eos_token_id":
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
| 6 |
"transformers_version": "4.54.1"
|
| 7 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 128000,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
128001,
|
| 6 |
+
128008,
|
| 7 |
+
128009
|
| 8 |
+
],
|
| 9 |
"transformers_version": "4.54.1"
|
| 10 |
}
|
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:e2c5aeb07d4e6e23406ee8bcb36b04700fb73364cdebe8991491dab02777a9f3
|
| 3 |
+
size 150233704
|