Text Generation
Transformers
Safetensors
qwen2
llama-factory
full
Generated from Trainer
conversational
text-generation-inference
Instructions to use lllqaq/R2EGym-14B-Agent-Coder-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lllqaq/R2EGym-14B-Agent-Coder-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lllqaq/R2EGym-14B-Agent-Coder-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("lllqaq/R2EGym-14B-Agent-Coder-Instruct") model = AutoModelForCausalLM.from_pretrained("lllqaq/R2EGym-14B-Agent-Coder-Instruct", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use lllqaq/R2EGym-14B-Agent-Coder-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lllqaq/R2EGym-14B-Agent-Coder-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lllqaq/R2EGym-14B-Agent-Coder-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/lllqaq/R2EGym-14B-Agent-Coder-Instruct
- SGLang
How to use lllqaq/R2EGym-14B-Agent-Coder-Instruct 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 "lllqaq/R2EGym-14B-Agent-Coder-Instruct" \ --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": "lllqaq/R2EGym-14B-Agent-Coder-Instruct", "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 "lllqaq/R2EGym-14B-Agent-Coder-Instruct" \ --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": "lllqaq/R2EGym-14B-Agent-Coder-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use lllqaq/R2EGym-14B-Agent-Coder-Instruct with Docker Model Runner:
docker model run hf.co/lllqaq/R2EGym-14B-Agent-Coder-Instruct
Upload train_r2egym_14B_agent_coder_instruct.yaml
Browse files
train_r2egym_14B_agent_coder_instruct.yaml
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 论文训练参数+正常推理参数
|
| 2 |
+
### model
|
| 3 |
+
model_name_or_path: Qwen/Qwen2.5-Coder-14B-Instruct
|
| 4 |
+
trust_remote_code: true
|
| 5 |
+
|
| 6 |
+
### method
|
| 7 |
+
stage: sft
|
| 8 |
+
do_train: true
|
| 9 |
+
finetuning_type: full
|
| 10 |
+
deepspeed: /home/xuye_liu/yubo/LLaMA-Factory/examples/deepspeed/ds_z3_config.json
|
| 11 |
+
|
| 12 |
+
### dataset
|
| 13 |
+
dataset: r2egym_sft_trajectories
|
| 14 |
+
dataset_dir: /home/xuye_liu/yubo/LLaMA-Factory/data
|
| 15 |
+
template: qwen
|
| 16 |
+
cutoff_len: 20000
|
| 17 |
+
max_samples: 100000
|
| 18 |
+
overwrite_cache: true
|
| 19 |
+
preprocessing_num_workers: 16
|
| 20 |
+
|
| 21 |
+
### output
|
| 22 |
+
output_dir: /home/xuye_liu/yubo/LLaMA-Factory/saves/R2EGym-14B-Agent-Coder-Instruct
|
| 23 |
+
logging_steps: 10
|
| 24 |
+
resume_from_checkpoint: null
|
| 25 |
+
save_steps: 200
|
| 26 |
+
plot_loss: true
|
| 27 |
+
overwrite_output_dir: false
|
| 28 |
+
|
| 29 |
+
### train
|
| 30 |
+
flash_attn: fa2
|
| 31 |
+
enable_liger_kernel: true
|
| 32 |
+
use_unsloth_gc: true
|
| 33 |
+
|
| 34 |
+
per_device_train_batch_size: 1
|
| 35 |
+
# Global batch size = per_device_train_batch_size * gradient_accumulation_steps * world_size.
|
| 36 |
+
# Using GPUs 4,5,6,7 => world_size=4, so 1 * 2 * 4 = 8.
|
| 37 |
+
gradient_accumulation_steps: 2
|
| 38 |
+
|
| 39 |
+
learning_rate: 1.0e-5
|
| 40 |
+
weight_decay: 0.05
|
| 41 |
+
num_train_epochs: 2.0
|
| 42 |
+
lr_scheduler_type: cosine
|
| 43 |
+
warmup_ratio: 0.1
|
| 44 |
+
bf16: true
|
| 45 |
+
ddp_timeout: 180000000
|
| 46 |
+
|
| 47 |
+
### wandb
|
| 48 |
+
report_to: none
|
| 49 |
+
run_name: R2EGym-14B-Agent-Coder
|