Text Generation
Transformers
PyTorch
TensorBoard
Safetensors
llama
Generated from Trainer
axolotl
trl
kto
conversational
text-generation-inference
Instructions to use jeiku/controlkto with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jeiku/controlkto with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jeiku/controlkto") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("jeiku/controlkto") model = AutoModelForCausalLM.from_pretrained("jeiku/controlkto") 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 jeiku/controlkto with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jeiku/controlkto" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jeiku/controlkto", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/jeiku/controlkto
- SGLang
How to use jeiku/controlkto 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 "jeiku/controlkto" \ --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": "jeiku/controlkto", "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 "jeiku/controlkto" \ --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": "jeiku/controlkto", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use jeiku/controlkto with Docker Model Runner:
docker model run hf.co/jeiku/controlkto
Upload controlkto.yml
Browse files- controlkto.yml +90 -0
controlkto.yml
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
base_model: Delta-Vector/Control-8B-V1.1
|
| 2 |
+
model_type: AutoModelForCausalLM
|
| 3 |
+
tokenizer_type: AutoTokenizer
|
| 4 |
+
|
| 5 |
+
load_in_8bit: false
|
| 6 |
+
load_in_4bit: false
|
| 7 |
+
strict: false
|
| 8 |
+
|
| 9 |
+
hub_model_id: jeiku/controlkto
|
| 10 |
+
hub_strategy: "all_checkpoints"
|
| 11 |
+
push_dataset_to_hub:
|
| 12 |
+
hf_use_auth_token: true
|
| 13 |
+
|
| 14 |
+
chat_template: llama3
|
| 15 |
+
|
| 16 |
+
rl: kto
|
| 17 |
+
rl_beta: 0.2
|
| 18 |
+
kto_desirable_weight: 0.2
|
| 19 |
+
|
| 20 |
+
datasets:
|
| 21 |
+
- path: anthracite-core/full-opus-chosen-hermes-rejected-kto-v1
|
| 22 |
+
type: llama3.argilla
|
| 23 |
+
|
| 24 |
+
shuffle_merged_datasets: true
|
| 25 |
+
val_set_size: 0.0
|
| 26 |
+
output_dir: ./outputs/out
|
| 27 |
+
|
| 28 |
+
adapter: lora
|
| 29 |
+
lora_model_dir:
|
| 30 |
+
|
| 31 |
+
lora_r: 32
|
| 32 |
+
lora_alpha: 64
|
| 33 |
+
lora_dropout: 0.05
|
| 34 |
+
lora_target_linear: true
|
| 35 |
+
lora_fan_in_fan_out:
|
| 36 |
+
|
| 37 |
+
sequence_len: 8192
|
| 38 |
+
sample_packing: false
|
| 39 |
+
eval_sample_packing: false
|
| 40 |
+
pad_to_sequence_len: false
|
| 41 |
+
|
| 42 |
+
wandb_project: controlkto
|
| 43 |
+
wandb_entity:
|
| 44 |
+
wandb_watch:
|
| 45 |
+
wandb_name: controlkto
|
| 46 |
+
wandb_log_model:
|
| 47 |
+
|
| 48 |
+
gradient_accumulation_steps: 16
|
| 49 |
+
micro_batch_size: 2
|
| 50 |
+
num_epochs: 2
|
| 51 |
+
max_steps: 500
|
| 52 |
+
|
| 53 |
+
optimizer: adamw_8bit
|
| 54 |
+
lr_scheduler: cosine
|
| 55 |
+
learning_rate: 0.0001
|
| 56 |
+
weight_decay: 0.05
|
| 57 |
+
|
| 58 |
+
train_on_inputs: false
|
| 59 |
+
group_by_length: false
|
| 60 |
+
bf16: auto
|
| 61 |
+
fp16:
|
| 62 |
+
tf32: true
|
| 63 |
+
|
| 64 |
+
gradient_checkpointing: true
|
| 65 |
+
gradient_checkpointing_kwargs:
|
| 66 |
+
use_reentrant: true
|
| 67 |
+
remove_unused_columns: false
|
| 68 |
+
early_stopping_patience:
|
| 69 |
+
resume_from_checkpoint:
|
| 70 |
+
local_rank:
|
| 71 |
+
logging_steps: 1
|
| 72 |
+
xformers_attention:
|
| 73 |
+
flash_attention: true
|
| 74 |
+
|
| 75 |
+
warmup_steps: 10
|
| 76 |
+
evals_per_epoch: 2
|
| 77 |
+
eval_table_size:
|
| 78 |
+
eval_max_new_tokens:
|
| 79 |
+
saves_per_epoch: 1
|
| 80 |
+
|
| 81 |
+
debug:
|
| 82 |
+
deepspeed:
|
| 83 |
+
fsdp:
|
| 84 |
+
fsdp_config:
|
| 85 |
+
fsdp:
|
| 86 |
+
fsdp_config:
|
| 87 |
+
|
| 88 |
+
special_tokens:
|
| 89 |
+
pad_token: <|finetune_right_pad_id|>
|
| 90 |
+
eos_token: <|eot_id|>
|