Text Generation
Transformers
Safetensors
code
t5
text2text-generation
codet5
code-repair
program-repair
bug-fixing
java
seq2seq
Eval Results (legacy)
text-generation-inference
Instructions to use thealper2/codet5-base-code-repair with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use thealper2/codet5-base-code-repair with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="thealper2/codet5-base-code-repair")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("thealper2/codet5-base-code-repair") model = AutoModelForSeq2SeqLM.from_pretrained("thealper2/codet5-base-code-repair", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use thealper2/codet5-base-code-repair with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "thealper2/codet5-base-code-repair" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thealper2/codet5-base-code-repair", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/thealper2/codet5-base-code-repair
- SGLang
How to use thealper2/codet5-base-code-repair 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/codet5-base-code-repair" \ --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/codet5-base-code-repair", "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/codet5-base-code-repair" \ --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/codet5-base-code-repair", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use thealper2/codet5-base-code-repair with Docker Model Runner:
docker model run hf.co/thealper2/codet5-base-code-repair
Download run_config.json from thealper2/codet5-base-code-repair: direct link, hf CLI and curl.
- Browser
- Download file 1.44 kB
-
https://huggingface.co/thealper2/codet5-base-code-repair/resolve/main/run_config.json
- Command line
-
hf download hf://thealper2/codet5-base-code-repair/run_config.json
-
curl -L -o run_config.json https://huggingface.co/thealper2/codet5-base-code-repair/resolve/main/run_config.json
1.44 kB
| { | |
| "model_name": "Salesforce/codet5-base", | |
| "dataset_name": "google/code_x_glue_cc_code_refinement", | |
| "dataset_config": "small", | |
| "source_column": null, | |
| "target_column": null, | |
| "language": "java", | |
| "train_split": "train", | |
| "eval_split": "validation", | |
| "test_split": "test", | |
| "max_source_length": 256, | |
| "max_target_length": 256, | |
| "pad_to_multiple_of": 8, | |
| "learning_rate": 5e-05, | |
| "per_device_train_batch_size": 16, | |
| "per_device_eval_batch_size": 64, | |
| "gradient_accumulation_steps": 2, | |
| "num_train_epochs": 10.0, | |
| "weight_decay": 0.01, | |
| "warmup_ratio": 0.05, | |
| "lr_scheduler_type": "linear", | |
| "max_grad_norm": 1.0, | |
| "label_smoothing_factor": 0.0, | |
| "gradient_checkpointing": false, | |
| "eval_strategy": "epoch", | |
| "save_strategy": "epoch", | |
| "logging_steps": 100, | |
| "save_total_limit": 2, | |
| "load_best_model_at_end": true, | |
| "metric_for_best_model": "exact_match", | |
| "greater_is_better": true, | |
| "early_stopping_patience": 3, | |
| "eval_subset_size": 1000, | |
| "max_eval_examples": 0, | |
| "num_beams": 4, | |
| "max_new_tokens": 256, | |
| "generation_early_stopping": true, | |
| "length_penalty": 1.0, | |
| "no_repeat_ngram_size": 0, | |
| "seed": 42, | |
| "output_dir": "outputs/codet5-base-code-repair", | |
| "precision": "auto", | |
| "dataloader_num_workers": 4, | |
| "report_to": "none", | |
| "resume_from_checkpoint": null, | |
| "compute_codebleu": true, | |
| "smoke_test": false, | |
| "smoke_train_size": 256, | |
| "smoke_eval_size": 32, | |
| "smoke_epochs": 1.0 | |
| } |