Text Generation
Transformers
Safetensors
English
t5
text2text-generation
commit-message-generation
summarization
code
text-generation-inference
Instructions to use thealper2/t5-small-commitbench with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use thealper2/t5-small-commitbench with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="thealper2/t5-small-commitbench")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("thealper2/t5-small-commitbench") model = AutoModelForSeq2SeqLM.from_pretrained("thealper2/t5-small-commitbench", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use thealper2/t5-small-commitbench with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "thealper2/t5-small-commitbench" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thealper2/t5-small-commitbench", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/thealper2/t5-small-commitbench
- SGLang
How to use thealper2/t5-small-commitbench 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 "thealper2/t5-small-commitbench" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thealper2/t5-small-commitbench", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "thealper2/t5-small-commitbench" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thealper2/t5-small-commitbench", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use thealper2/t5-small-commitbench with Docker Model Runner:
docker model run hf.co/thealper2/t5-small-commitbench
File size: 1,589 Bytes
1eb78b1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | {
"data": {
"dataset_name": "Maxscha/commitbench",
"cache_dir": null,
"prefix": "generate commit message: ",
"target_mode": "full",
"max_source_length": 512,
"max_target_length": 64,
"min_diff_chars": 1,
"min_message_chars": 1,
"num_proc": 8,
"max_train_samples": 500000,
"max_eval_samples": 2000,
"max_predict_samples": null
},
"train": {
"model_name": "google-t5/t5-small",
"output_dir": "outputs/t5-small-commitbench",
"seed": 42,
"deterministic": false,
"learning_rate": 3e-05,
"num_train_epochs": 2.0,
"per_device_train_batch_size": 32,
"per_device_eval_batch_size": 64,
"gradient_accumulation_steps": 1,
"weight_decay": 0.01,
"warmup_ratio": 0.05,
"label_smoothing_factor": 0.0,
"max_grad_norm": 1.0,
"lr_scheduler_type": "linear",
"eval_strategy": "steps",
"save_strategy": "steps",
"eval_steps": 3000,
"save_steps": 3000,
"logging_steps": 250,
"save_total_limit": 2,
"metric_for_best_model": "eval_loss",
"greater_is_better": false,
"load_best_model_at_end": true,
"gradient_checkpointing": false,
"torch_compile": true,
"torch_compile_mode": "",
"group_by_length": true,
"dataloader_num_workers": 4,
"precision": "auto",
"resume_from_checkpoint": null,
"max_steps": -1
},
"generation": {
"num_beams": 4,
"max_new_tokens": 64,
"min_new_tokens": 0,
"length_penalty": 1.0,
"no_repeat_ngram_size": 3,
"early_stopping": true,
"do_sample": false,
"eval_num_beams": 1
}
} |