hardlyworking/HardlyRPv2
Viewer • Updated • 24.7k • 17
How to use hardlyworking/HoldMy4BKTO with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="hardlyworking/HoldMy4BKTO")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("hardlyworking/HoldMy4BKTO")
model = AutoModelForCausalLM.from_pretrained("hardlyworking/HoldMy4BKTO")
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 hardlyworking/HoldMy4BKTO with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "hardlyworking/HoldMy4BKTO"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "hardlyworking/HoldMy4BKTO",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/hardlyworking/HoldMy4BKTO
How to use hardlyworking/HoldMy4BKTO with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "hardlyworking/HoldMy4BKTO" \
--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": "hardlyworking/HoldMy4BKTO",
"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 "hardlyworking/HoldMy4BKTO" \
--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": "hardlyworking/HoldMy4BKTO",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use hardlyworking/HoldMy4BKTO with Docker Model Runner:
docker model run hf.co/hardlyworking/HoldMy4BKTO
axolotl version: 0.10.0
base_model: Salesforce/xgen-small-4B-instruct-r
load_in_8bit: false
load_in_4bit: false
strict: false
chat_template: chatml
datasets:
- path: hardlyworking/HardlyRPv2
type: chat_template
split: train
field_messages: conversations
message_property_mappings:
role: from
content: value
val_set_size: 0.1
output_dir: ./outputs/out
dataset_prepared_path: last_run_prepared
shuffle_merged_datasets: true
hub_model_id: hardlyworking/HoldMy4B
hub_strategy: "all_checkpoints"
push_dataset_to_hub:
hf_use_auth_token: true
plugins:
- axolotl.integrations.liger.LigerPlugin
- axolotl.integrations.cut_cross_entropy.CutCrossEntropyPlugin
liger_rope: true
liger_rms_norm: true
liger_layer_norm: true
liger_glu_activation: true
liger_fused_linear_cross_entropy: false
cut_cross_entropy: true
sequence_len: 32768
sample_packing: true
eval_sample_packing: true
pad_to_sequence_len: true
wandb_project: Xgen4B
wandb_entity:
wandb_watch:
wandb_name: Xgen4B
wandb_log_model:
evals_per_epoch: 8
eval_table_size:
eval_max_new_tokens: 128
gradient_accumulation_steps: 2
micro_batch_size: 2
num_epochs: 2
optimizer: adamw_bnb_8bit
lr_scheduler: cosine
learning_rate: 1e-5
train_on_inputs: false
group_by_length: false
bf16: auto
fp16:
tf32: false
gradient_checkpointing: offload
gradient_checkpointing_kwargs:
use_reentrant: false
early_stopping_patience:
resume_from_checkpoint:
local_rank:
logging_steps: 1
xformers_attention:
flash_attention: true
s2_attention:
deepspeed:
warmup_ratio: 0.05
saves_per_epoch: 1
debug:
weight_decay: 0.01
fsdp:
fsdp_config:
special_tokens:
pad_token:
This model is a fine-tuned version of Salesforce/xgen-small-4B-instruct-r on the hardlyworking/HardlyRPv2 dataset. It achieves the following results on the evaluation set:
More information needed
More information needed
More information needed
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| No log | 0 | 0 | 2.6420 |
| 2.0119 | 0.125 | 30 | 2.2105 |
| 1.8963 | 0.25 | 60 | 2.1865 |
| 1.8623 | 0.375 | 90 | 2.1787 |
| 1.8528 | 0.5 | 120 | 2.1746 |
| 1.8784 | 0.625 | 150 | 2.1706 |
| 1.9961 | 0.75 | 180 | 2.1686 |
| 1.8748 | 0.875 | 210 | 2.1672 |
| 2.0385 | 1.0 | 240 | 2.1657 |
| 1.9327 | 1.125 | 270 | 2.1646 |
| 1.8509 | 1.25 | 300 | 2.1645 |
| 1.8279 | 1.375 | 330 | 2.1640 |
| 1.8271 | 1.5 | 360 | 2.1638 |
| 1.8589 | 1.625 | 390 | 2.1637 |
| 1.9824 | 1.75 | 420 | 2.1637 |
| 1.8668 | 1.875 | 450 | 2.1637 |
| 2.0332 | 2.0 | 480 | 2.1637 |
Base model
Salesforce/xgen-small-4B-instruct-r