Text Generation
Transformers
Safetensors
English
code
t5
text2text-generation
security
vulnerability-fix
code-repair
code-generation
codet5
owasp
cwe
Eval Results (legacy)
text-generation-inference
Instructions to use ayshajavd/codet5p-vuln-fixer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ayshajavd/codet5p-vuln-fixer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ayshajavd/codet5p-vuln-fixer")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("ayshajavd/codet5p-vuln-fixer") model = AutoModelForSeq2SeqLM.from_pretrained("ayshajavd/codet5p-vuln-fixer", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ayshajavd/codet5p-vuln-fixer with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ayshajavd/codet5p-vuln-fixer" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ayshajavd/codet5p-vuln-fixer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ayshajavd/codet5p-vuln-fixer
- SGLang
How to use ayshajavd/codet5p-vuln-fixer 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 "ayshajavd/codet5p-vuln-fixer" \ --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": "ayshajavd/codet5p-vuln-fixer", "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 "ayshajavd/codet5p-vuln-fixer" \ --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": "ayshajavd/codet5p-vuln-fixer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ayshajavd/codet5p-vuln-fixer with Docker Model Runner:
docker model run hf.co/ayshajavd/codet5p-vuln-fixer
Download eval_results.json from ayshajavd/codet5p-vuln-fixer: direct link, hf CLI and curl.
- Browser
- Download file 1.65 kB
-
https://huggingface.co/ayshajavd/codet5p-vuln-fixer/resolve/main/eval_results.json
- Command line
-
hf download hf://ayshajavd/codet5p-vuln-fixer/eval_results.json
-
curl -L -o eval_results.json https://huggingface.co/ayshajavd/codet5p-vuln-fixer/resolve/main/eval_results.json
1.65 kB
| { | |
| "base_model": "Salesforce/codet5p-220m", | |
| "hub_model_id": "ayshajavd/codet5p-vuln-fixer", | |
| "test_metrics": { | |
| "test_loss": 0.5855351090431213, | |
| "test_bleu": 80.9960114403252, | |
| "test_rouge1": 0.8024324514048476, | |
| "test_rouge2": 0.7445122033334747, | |
| "test_rougeL": 0.787991981438898, | |
| "test_codebleu": 0.0, | |
| "test_exact_match": 0.01381509032943677, | |
| "test_runtime": 1021.1841, | |
| "test_samples_per_second": 0.921, | |
| "test_steps_per_second": 0.058 | |
| }, | |
| "training_config": { | |
| "epochs_trained": 6, | |
| "best_epoch": 3, | |
| "early_stopped": true, | |
| "best_eval_loss": 0.1752, | |
| "learning_rate": 0.0001, | |
| "lr_scheduler_type": "constant", | |
| "effective_batch_size": 32, | |
| "per_device_batch_size": 8, | |
| "gradient_accumulation_steps": 2, | |
| "max_source_length": 512, | |
| "max_target_length": 512, | |
| "precision": "float16", | |
| "gradient_checkpointing": true, | |
| "generation_num_beams": 5, | |
| "early_stopping_patience": 3 | |
| }, | |
| "improvements_over_v1": [ | |
| "CodeT5+ 220M (was flan-t5-small 60M \u2014 3.7x larger)", | |
| "CWE-aware input: 'fix <vulnerability_name> in <language>: <code>'", | |
| "BLEU + CodeBLEU + ROUGE + exact match evaluation", | |
| "lr=1e-4 constant scheduler (T5APR/MultiMend validated)", | |
| "Early stopping (patience=3) to prevent overfitting", | |
| "fp16 + gradient checkpointing for memory efficiency", | |
| "Dynamic padding for faster training", | |
| "Fixed tokenizer loading (patched special_tokens_map.json bug)" | |
| ], | |
| "training_data": { | |
| "dataset": "ayshajavd/code-security-vulnerability-dataset", | |
| "train_samples": 7374, | |
| "val_samples": 994, | |
| "test_samples": 941 | |
| } | |
| } |