AlexHung29629/rr-mg-segmented
Viewer • Updated • 1.38k • 2
How to use AlexHung29629/fix_magistral3 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="AlexHung29629/fix_magistral3")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("AlexHung29629/fix_magistral3")
model = AutoModelForCausalLM.from_pretrained("AlexHung29629/fix_magistral3")
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 AlexHung29629/fix_magistral3 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "AlexHung29629/fix_magistral3"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "AlexHung29629/fix_magistral3",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/AlexHung29629/fix_magistral3
How to use AlexHung29629/fix_magistral3 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "AlexHung29629/fix_magistral3" \
--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": "AlexHung29629/fix_magistral3",
"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 "AlexHung29629/fix_magistral3" \
--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": "AlexHung29629/fix_magistral3",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use AlexHung29629/fix_magistral3 with Docker Model Runner:
docker model run hf.co/AlexHung29629/fix_magistral3
axolotl version: 0.11.0.dev0
base_model: AlexHung29629/Magistral-Small-2506
tokenizer_use_mistral_common: false
plugins:
- axolotl.integrations.liger.LigerPlugin
liger_rope: true
liger_rms_norm: true
liger_glu_activation: true
liger_fused_linear_cross_entropy: true
#unfrozen_parameters:
# - ^lm_head.weight$
# - ^model.layers.39.*$
datasets:
- path: AlexHung29629/rr-mg-segmented
type: input_output
remove_unused_columns: false
sequence_len: 8192
sample_packing: true
eval_sample_packing: false
pad_to_sequence_len: true
use_tensorboard: true
save_only_model: true
gradient_accumulation_steps: 1
micro_batch_size: 1
num_epochs: 2
optimizer: adamw_torch_fused
#optimizer: adamw_bnb_8bit
lr_scheduler: cosine
learning_rate: 5e-7
max_grad_norm: 1.0
adam_beta1: 0.9
adam_beta2: 0.95
adam_epsilon: 1e-8
bf16: true
tf32: false
warmup_ratio: 0.05
saves_per_epoch: 1
weight_decay: 0
train_on_inputs: false
flash_attention: true
#deepspeed: /workspace/output/zero3.json
fsdp:
- full_shard
- auto_wrap
fsdp_config:
fsdp_limit_all_gathers: true
fsdp_sync_module_states: true
fsdp_offload_params: false
fsdp_use_orig_params: true
fsdp_cpu_ram_efficient_loading: true
fsdp_activation_checkpointing: true
fsdp_transformer_layer_cls_to_wrap: MistralDecoderLayer
fsdp_state_dict_type: FULL_STATE_DICT
fsdp_auto_wrap_policy: TRANSFORMER_BASED_WRAP
seed: 42
hub_model_id: AlexHung29629/fix_magistral3
output_dir: /workspace/output/output_dir3
dataset_processes: 0
dataset_prepared_path: /workspace/output/dataset_prepared
torch_compile: false
added_tokens_overrides:
32: "[ARGS]"
33: "[CALL_ID]"
This model is a fine-tuned version of AlexHung29629/Magistral-Small-2506 on the AlexHung29629/rr-mg-segmented dataset.
More information needed
More information needed
More information needed
The following hyperparameters were used during training:
Base model
AlexHung29629/Magistral-Small-2506