Text Generation
Transformers
Safetensors
apertus
axolotl
Generated from Trainer
conversational
custom_code
Instructions to use BirdToast/new-apertus-12b-s1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BirdToast/new-apertus-12b-s1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BirdToast/new-apertus-12b-s1", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("BirdToast/new-apertus-12b-s1", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("BirdToast/new-apertus-12b-s1", trust_remote_code=True) 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 BirdToast/new-apertus-12b-s1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BirdToast/new-apertus-12b-s1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BirdToast/new-apertus-12b-s1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/BirdToast/new-apertus-12b-s1
- SGLang
How to use BirdToast/new-apertus-12b-s1 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 "BirdToast/new-apertus-12b-s1" \ --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": "BirdToast/new-apertus-12b-s1", "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 "BirdToast/new-apertus-12b-s1" \ --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": "BirdToast/new-apertus-12b-s1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use BirdToast/new-apertus-12b-s1 with Docker Model Runner:
docker model run hf.co/BirdToast/new-apertus-12b-s1
See axolotl config
axolotl version: 0.15.0.dev0
# === Model Configuration ===
base_model: rpDungeon/new-apertus-12b-untrained
load_in_8bit: false
load_in_4bit: false
# === HF Configuration ===
hub_model_id: BirdToast/new-apertus-12b-s1
hub_strategy: "every_save"
output_dir: ckpts
# === Wandb Tracking ===
wandb_project: ApertusV4
# wandb_entity: [WANDB_ENTITY]
wandb_name: 12b-cpt-s1
# === Training Setup ===
num_epochs: 1
micro_batch_size: 4
gradient_accumulation_steps: 1
sequence_len: 512
#sequence_parallel_degree: 2
#heads_k_stride: 1
sample_packing: true
#pad_to_sequence_len: true
#temperature: 0.7
#max_steps: 10
# === Evaluation ===
#val_set_size: 100
#evals_per_epoch: 10
#eval_steps: 20
#max_steps: 60
#eval_table_size:
#eval_max_new_tokens: 128
#eval_sample_packing: true
eval_strategy: "no"
# === LoRA Configuration ===
adapter:
lora_model_dir:
lora_r: 128
lora_alpha: 16
lora_dropout: 0.05
lora_target_linear: true
lora_target_modules:
# - up_proj
# - down_proj
# - gate_proj
# - q_proj
# - v_proj
# - k_proj
# - o_proj
# - input_layernorm
# - post_attention_layernorm
# - embed_tokens
# - lm_head
lora_fan_in_fan_out:
peft_use_rslora: true
lora_modules_to_save:
# - embed_tokens
# - lm_head
#fix_untrained_tokens: true
#lora_mlp_kernel: true
#lora_qkv_kernel: true
#lora_o_kernel: true
unfrozen_parameters:
- model.layers.(2[4-9]|3[0-9]).*
# - model.layers.[0-9+].mlp.up_proj
# - model.layers.[0-9+].mlp.down_proj
# - model.layers.[0-9+].feedforward_layernorm
# - embed_tokens
# - lm_head
# === Hyperparameter Configuration ===
#optimizer: apollo_adamw_layerwise
#warmup_steps: 0
warmup_ratio: 0.025
#optimizer: adamw_torch_fused
optimizer: came_pytorch
optim_args:
enable_stochastic_rounding: true
enable_cautious: true
enable_cautious_weight_decay: true
# enable_8bit: true
# Apollo-mini configuration:
#optim_args: "proj=random,rank=128,scale=128.0,scale_type=tensor,update_proj_gap=100"
# Regular Apollo configuration:
# optim_args:
#optim_target_modules: all_linear
learning_rate: 1e-4
lr_scheduler: cosine
#cosine_min_lr_ratio: 0.2
#lr_scheduler: cosine_with_min_lr
#lr_scheduler_kwargs:
# cosine_min_lr: 1e-6
weight_decay: 0.01
max_grad_norm: 1.0
#warmup_steps: 0
#warmup_ratio: 0.025
# === Data Configuration ===
#
#chat_template: jinja
chat_template: chatml
special_tokens:
# eos_token: "<|im_end|>"
# eos_token: "</s>"
#tokenizer_use_mistral_common: true
shuffle_merged_datasets: true
datasets:
- path: rpDungeon/marvin
data_files: marvin_full_text_only.json
type: completion
dataset_prepared_path: last_run_prepared
# === Plugins ===
plugins:
- axolotl.integrations.liger.LigerPlugin
- axolotl.integrations.cut_cross_entropy.CutCrossEntropyPlugin
# === Hardware Optimization ===
gradient_checkpointing: true
liger_rope: true
liger_rms_norm: true
liger_layer_norm: true
liger_glu_activation: true
#liger_fused_linear_cross_entropy: true
cut_cross_entropy: true
#deepspeed: ../axolotl/deepspeed_configs/zero2.json
# === Checkpointing ===
#save_steps: 2
saves_per_epoch: 1
save_total_limit: 1
# === Advanced Settings ===
bf16: auto
flash_attention: true
train_on_inputs: false
group_by_length: false
save_safetensors: true
logging_steps: 1
seed: 69
gc_steps: 10
new-apertus-12b-s1
This model is a fine-tuned version of rpDungeon/new-apertus-12b-untrained on the rpDungeon/marvin 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: 0.0001
- train_batch_size: 4
- eval_batch_size: 4
- seed: 69
- 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: cosine
- lr_scheduler_warmup_steps: 68
- training_steps: 2730
Training results
Framework versions
- Transformers 4.57.3
- Pytorch 2.8.0+cu128
- Datasets 4.5.0
- Tokenizers 0.22.2
- Downloads last month
- 3