Text Generation
Transformers
PyTorch
Safetensors
llama
axolotl
Generated from Trainer
conversational
text-generation-inference
Instructions to use smohammadi/qat-llama-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use smohammadi/qat-llama-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="smohammadi/qat-llama-3B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("smohammadi/qat-llama-3B") model = AutoModelForMultimodalLM.from_pretrained("smohammadi/qat-llama-3B") 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 Settings
- vLLM
How to use smohammadi/qat-llama-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "smohammadi/qat-llama-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "smohammadi/qat-llama-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/smohammadi/qat-llama-3B
- SGLang
How to use smohammadi/qat-llama-3B 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 "smohammadi/qat-llama-3B" \ --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": "smohammadi/qat-llama-3B", "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 "smohammadi/qat-llama-3B" \ --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": "smohammadi/qat-llama-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use smohammadi/qat-llama-3B with Docker Model Runner:
docker model run hf.co/smohammadi/qat-llama-3B
metadata
library_name: transformers
license: llama3.2
base_model: meta-llama/Llama-3.2-3B-Instruct
tags:
- axolotl
- generated_from_trainer
datasets:
- yahma/alpaca-cleaned
model-index:
- name: qat-llama-3B
results: []
See axolotl config
axolotl version: 0.13.0.dev0
base_model: meta-llama/Llama-3.2-3B-Instruct
# Automatically upload checkpoint and final model to HF
hub_model_id: smohammadi/qat-llama-3B # username/custom_model_name
load_in_8bit: false
load_in_4bit: false
strict: false
#liger_rope: true
#liger_rms_norm: true
#liger_glu_activation: true
#liger_layer_norm: true
#
#liger_fused_linear_cross_entropy: true
datasets:
- path: yahma/alpaca-cleaned
type: alpaca
split: train[:95%]
output_dir: ./outputs/qat-train_on_inputs/
dataset_prepared_path: ./outputs/ds_prepared_new_token
#sample_packing: true
sequence_len: 8192
flash_attention: true
#flex_attention: true
#flex_attn_compile_kwargs:
# dynamic: false
# mode: max-autotune-no-cudagraphs
qat:
activation_dtype: int8
weight_dtype: int4
group_size: 32
wandb_project: qat_v2
wandb_entity:
wandb_watch:
wandb_name: qat-train-on-inputs
wandb_log_model:
gradient_accumulation_steps: 1
micro_batch_size: 16
num_epochs: 1
optimizer: adamw_torch_fused
train_on_inputs: true
#cosine_constant_lr_ratio: 0
#cosine_min_lr_ratio: 1.0
lr_scheduler: constant
learning_rate: 2e-5
save_only_model: true
bf16: true
resume_from_checkpoint:
logging_steps: 1
include_tkps: true
evals_per_epoch: 1
saves_per_epoch: 1
#warmup_ratio: 0.1
weight_decay: 0.0
fsdp_config:
fsdp_version: 2
fsdp_offload_params: false
fsdp_cpu_ram_efficient_loading: False
fsdp_auto_wrap_policy: TRANSFORMER_BASED_WRAP
fsdp_transformer_layer_cls_to_wrap: LlamaDecoderLayer
fsdp_state_dict_type: FULL_STATE_DICT
fsdp_sharding_strategy: FULL_SHARD
fsdp_reshard_after_forward: true
fsdp_activation_checkpointing: true
special_tokens:
pad_token: <|finetune_right_pad_id|>
qat-llama-3B
This model is a fine-tuned version of meta-llama/Llama-3.2-3B-Instruct on the yahma/alpaca-cleaned dataset.
Model description
More information needed
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 2e-05
- train_batch_size: 16
- eval_batch_size: 16
- seed: 42
- distributed_type: multi-GPU
- num_devices: 4
- total_train_batch_size: 64
- total_eval_batch_size: 64
- optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: constant
- lr_scheduler_warmup_steps: 23
- training_steps: 769
Training results
Framework versions
- Transformers 4.55.3
- Pytorch 2.7.1+cu126
- Datasets 4.0.0
- Tokenizers 0.21.4