Text Generation
PEFT
Safetensors
Transformers
qwen2
lora
sft
trl
conversational
text-generation-inference
Instructions to use Vigp17/agentcode-14b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Vigp17/agentcode-14b with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-14B-Instruct") model = PeftModel.from_pretrained(base_model, "Vigp17/agentcode-14b") - Transformers
How to use Vigp17/agentcode-14b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Vigp17/agentcode-14b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("Vigp17/agentcode-14b") model = AutoModelForMultimodalLM.from_pretrained("Vigp17/agentcode-14b") 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 Vigp17/agentcode-14b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Vigp17/agentcode-14b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Vigp17/agentcode-14b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Vigp17/agentcode-14b
- SGLang
How to use Vigp17/agentcode-14b 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 "Vigp17/agentcode-14b" \ --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": "Vigp17/agentcode-14b", "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 "Vigp17/agentcode-14b" \ --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": "Vigp17/agentcode-14b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Vigp17/agentcode-14b with Docker Model Runner:
docker model run hf.co/Vigp17/agentcode-14b
| { | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 0.3827751196172249, | |
| "eval_steps": 200, | |
| "global_step": 500, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.019138755980861243, | |
| "grad_norm": 0.6331622004508972, | |
| "learning_rate": 6.25e-05, | |
| "loss": 1.2934, | |
| "step": 25 | |
| }, | |
| { | |
| "epoch": 0.03827751196172249, | |
| "grad_norm": 0.4265715181827545, | |
| "learning_rate": 9.921011058451817e-05, | |
| "loss": 0.646, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 0.05741626794258373, | |
| "grad_norm": 0.058480992913246155, | |
| "learning_rate": 9.723538704581358e-05, | |
| "loss": 0.526, | |
| "step": 75 | |
| }, | |
| { | |
| "epoch": 0.07655502392344497, | |
| "grad_norm": 0.03429209440946579, | |
| "learning_rate": 9.5260663507109e-05, | |
| "loss": 0.5069, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 0.09569377990430622, | |
| "grad_norm": 0.11788608133792877, | |
| "learning_rate": 9.328593996840442e-05, | |
| "loss": 0.4748, | |
| "step": 125 | |
| }, | |
| { | |
| "epoch": 0.11483253588516747, | |
| "grad_norm": 0.06252221018075943, | |
| "learning_rate": 9.131121642969984e-05, | |
| "loss": 0.4838, | |
| "step": 150 | |
| }, | |
| { | |
| "epoch": 0.1339712918660287, | |
| "grad_norm": 0.020096125081181526, | |
| "learning_rate": 8.933649289099526e-05, | |
| "loss": 0.4918, | |
| "step": 175 | |
| }, | |
| { | |
| "epoch": 0.15311004784688995, | |
| "grad_norm": 0.12325792759656906, | |
| "learning_rate": 8.736176935229068e-05, | |
| "loss": 0.5104, | |
| "step": 200 | |
| }, | |
| { | |
| "epoch": 0.15311004784688995, | |
| "eval_loss": 0.49960193037986755, | |
| "eval_runtime": 113.968, | |
| "eval_samples_per_second": 4.826, | |
| "eval_steps_per_second": 0.605, | |
| "step": 200 | |
| }, | |
| { | |
| "epoch": 0.1722488038277512, | |
| "grad_norm": 0.10687647014856339, | |
| "learning_rate": 8.53870458135861e-05, | |
| "loss": 0.5015, | |
| "step": 225 | |
| }, | |
| { | |
| "epoch": 0.19138755980861244, | |
| "grad_norm": 0.08051887899637222, | |
| "learning_rate": 8.341232227488151e-05, | |
| "loss": 0.4976, | |
| "step": 250 | |
| }, | |
| { | |
| "epoch": 0.21052631578947367, | |
| "grad_norm": 0.03358834236860275, | |
| "learning_rate": 8.143759873617693e-05, | |
| "loss": 0.4916, | |
| "step": 275 | |
| }, | |
| { | |
| "epoch": 0.22966507177033493, | |
| "grad_norm": 0.0065140132792294025, | |
| "learning_rate": 7.946287519747235e-05, | |
| "loss": 0.489, | |
| "step": 300 | |
| }, | |
| { | |
| "epoch": 0.24880382775119617, | |
| "grad_norm": 0.06022901087999344, | |
| "learning_rate": 7.748815165876777e-05, | |
| "loss": 0.5067, | |
| "step": 325 | |
| }, | |
| { | |
| "epoch": 0.2679425837320574, | |
| "grad_norm": 0.10035768896341324, | |
| "learning_rate": 7.551342812006318e-05, | |
| "loss": 0.4672, | |
| "step": 350 | |
| }, | |
| { | |
| "epoch": 0.28708133971291866, | |
| "grad_norm": 0.12114957720041275, | |
| "learning_rate": 7.35387045813586e-05, | |
| "loss": 0.4941, | |
| "step": 375 | |
| }, | |
| { | |
| "epoch": 0.3062200956937799, | |
| "grad_norm": 0.008501251228153706, | |
| "learning_rate": 7.156398104265402e-05, | |
| "loss": 0.5059, | |
| "step": 400 | |
| }, | |
| { | |
| "epoch": 0.3062200956937799, | |
| "eval_loss": 0.49782803654670715, | |
| "eval_runtime": 112.8287, | |
| "eval_samples_per_second": 4.875, | |
| "eval_steps_per_second": 0.612, | |
| "step": 400 | |
| }, | |
| { | |
| "epoch": 0.3253588516746411, | |
| "grad_norm": 0.13349683582782745, | |
| "learning_rate": 6.958925750394945e-05, | |
| "loss": 0.4999, | |
| "step": 425 | |
| }, | |
| { | |
| "epoch": 0.3444976076555024, | |
| "grad_norm": 0.07800962775945663, | |
| "learning_rate": 6.761453396524487e-05, | |
| "loss": 0.5059, | |
| "step": 450 | |
| }, | |
| { | |
| "epoch": 0.36363636363636365, | |
| "grad_norm": 0.08217480778694153, | |
| "learning_rate": 6.563981042654029e-05, | |
| "loss": 0.5114, | |
| "step": 475 | |
| }, | |
| { | |
| "epoch": 0.3827751196172249, | |
| "grad_norm": 0.07217281311750412, | |
| "learning_rate": 6.36650868878357e-05, | |
| "loss": 0.4855, | |
| "step": 500 | |
| } | |
| ], | |
| "logging_steps": 25, | |
| "max_steps": 1306, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 1, | |
| "save_steps": 500, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": false | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 1.7646732515386368e+17, | |
| "train_batch_size": 1, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |