allura-forge/claude-oss-sft
Viewer • Updated • 43.8k • 17
How to use allura-forge/claumba-micro-sft with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="allura-forge/claumba-micro-sft")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("allura-forge/claumba-micro-sft")
model = AutoModelForCausalLM.from_pretrained("allura-forge/claumba-micro-sft")
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]:]))How to use allura-forge/claumba-micro-sft with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "allura-forge/claumba-micro-sft"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "allura-forge/claumba-micro-sft",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/allura-forge/claumba-micro-sft
How to use allura-forge/claumba-micro-sft with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "allura-forge/claumba-micro-sft" \
--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": "allura-forge/claumba-micro-sft",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "allura-forge/claumba-micro-sft" \
--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": "allura-forge/claumba-micro-sft",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use allura-forge/claumba-micro-sft with Docker Model Runner:
docker model run hf.co/allura-forge/claumba-micro-sft
axolotl version: 0.13.0.dev0
# ------------------------------------------------------------------
# 0. Model & Tokeniser
# ------------------------------------------------------------------
base_model: ibm-granite/granite-4.0-h-micro
trust_remote_code: true
# ------------------------------------------------------------------
# 1. Precision & Memory
# ------------------------------------------------------------------
bf16: auto
fp16:
tf32: false
load_in_8bit: false
load_in_4bit: false
# vram helpers
flash_attention: true
# gradient_checkpointing: true # <-- uncomment if you want old-style GC instead of FSDP AC
# ------------------------------------------------------------------
# 2. FSDP (zero-3 + cpu-offload)
# ------------------------------------------------------------------
fsdp:
- auto_wrap
- full_shard
fsdp_config:
fsdp_version: 2
fsdp_offload_params: false
fsdp_cpu_ram_efficient_loading: true
fsdp_auto_wrap_policy: TRANSFORMER_BASED_WRAP
fsdp_transformer_layer_cls_to_wrap: GraniteMoeHybridDecoderLayer
fsdp_state_dict_type: SHARDED_STATE_DICT
fsdp_sharding_strategy: FULL_SHARD
fsdp_reshard_after_forward: true
fsdp_activation_checkpointing: true # disables itself if unsupported
# ------------------------------------------------------------------
# 3. Training Schedule
# ------------------------------------------------------------------
num_epochs: 2
learning_rate: 2e-5
lr_scheduler: cosine
warmup_ratio: 0.05
max_grad_norm: 0.1
weight_decay: 0.0
optimizer: adamw_torch_8bit
micro_batch_size: 2
gradient_accumulation_steps: 2
sequence_len: 8192
sample_packing: true
pad_to_sequence_len: true
# saves / eval frequency
saves_per_epoch: 4
val_set_size: 0.0
logging_steps: 1
strict: false
# ------------------------------------------------------------------
# 4. Data & Prompt Template
# ------------------------------------------------------------------
datasets:
- path: allura-forge/claude-oss-sft
type: chat_template
split: train
field_messages: conversations
message_field_role: from
message_field_content: value
chat_template: jinja
chat_template_jinja: |
{%- for message in messages -%}
{{- '<|start_of_role|>' + message['role'] + '<|end_of_role|>' + message['content'] + '<|end_of_text|>' -}}
{%- if loop.last and add_generation_prompt -%}
{{- '<|start_of_role|>assistant<|end_of_role|>' -}}
{%- endif -%}
{%- endfor -%}
shuffle_merged_datasets: true
dataset_prepared_path: last_run_prepared
remove_unused_columns: false
train_on_inputs: false
group_by_length: false
# ------------------------------------------------------------------
# 5. Plug-ins (memory / speed)
# ------------------------------------------------------------------
plugins:
- axolotl.integrations.liger.LigerPlugin
# ------------------------------------------------------------------
# 6. Weights & Biases
# ------------------------------------------------------------------
wandb_project: claumba-micro
wandb_name: woke
wandb_entity:
wandb_watch:
wandb_log_model:
# ------------------------------------------------------------------
# 7. I/O & Resume
# ------------------------------------------------------------------
output_dir: ./model-output
resume_from_checkpoint:
local_rank:
# ------------------------------------------------------------------
# 8. Unused / commented-out
# ------------------------------------------------------------------
# evals_per_epoch:
# eval_steps: 100
# eval_sample_packing: false
# early_stopping_patience:
# xformers_attention:
This model is a fine-tuned version of ibm-granite/granite-4.0-h-micro on the allura-forge/claude-oss-sft dataset.
More information needed
More information needed
More information needed
The following hyperparameters were used during training: