Text Generation
Transformers
PyTorch
Safetensors
llama
Eval Results (legacy)
text-generation-inference
Instructions to use patched-codes/patched-coder-34b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use patched-codes/patched-coder-34b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="patched-codes/patched-coder-34b")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("patched-codes/patched-coder-34b") model = AutoModelForCausalLM.from_pretrained("patched-codes/patched-coder-34b") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use patched-codes/patched-coder-34b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "patched-codes/patched-coder-34b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "patched-codes/patched-coder-34b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/patched-codes/patched-coder-34b
- SGLang
How to use patched-codes/patched-coder-34b 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 "patched-codes/patched-coder-34b" \ --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": "patched-codes/patched-coder-34b", "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 "patched-codes/patched-coder-34b" \ --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": "patched-codes/patched-coder-34b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use patched-codes/patched-coder-34b with Docker Model Runner:
docker model run hf.co/patched-codes/patched-coder-34b
Update README.md
Browse files
README.md
CHANGED
|
@@ -3,42 +3,42 @@ inference: false
|
|
| 3 |
datasets:
|
| 4 |
- bigcode/commitpackft
|
| 5 |
model-index:
|
| 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 |
# Model Card for patched-coder-34b
|
| 40 |
|
| 41 |
-
|
| 42 |
This is an instruction fine-tuned model focussed on the task of patching code. Patching may include fixing bugs, remediating security vulnerabilities,
|
| 43 |
doing API migrations and other kinds of code matainence.
|
| 44 |
|
|
@@ -113,9 +113,18 @@ The following `bitsandbytes` quantization config was used during training:
|
|
| 113 |
|
| 114 |
## Evaluation
|
| 115 |
|
| 116 |
-
We
|
| 117 |
[Code Generation LM Evaluation Harness](https://github.com/bigcode-project/bigcode-evaluation-harness).
|
| 118 |
|
| 119 |
-
|
| 120 |
|
| 121 |
### Results
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
datasets:
|
| 4 |
- bigcode/commitpackft
|
| 5 |
model-index:
|
| 6 |
+
- name: patched-coder-34b
|
| 7 |
+
results:
|
| 8 |
+
- task:
|
| 9 |
+
type: text-generation
|
| 10 |
+
dataset:
|
| 11 |
+
type: openai_humaneval
|
| 12 |
+
name: HumanEval
|
| 13 |
+
metrics:
|
| 14 |
+
- name: pass@1
|
| 15 |
+
type: pass@1
|
| 16 |
+
value: 53.567
|
| 17 |
+
verified: false
|
| 18 |
+
- task:
|
| 19 |
+
type: text-generation
|
| 20 |
+
dataset:
|
| 21 |
+
type: bigcode/humanevalpack
|
| 22 |
+
name: HumanEvalFix Python
|
| 23 |
+
metrics:
|
| 24 |
+
- name: pass@1
|
| 25 |
+
type: pass@1
|
| 26 |
+
value: 41.341
|
| 27 |
+
verified: false
|
| 28 |
+
- task:
|
| 29 |
+
type: text-generation
|
| 30 |
+
dataset:
|
| 31 |
+
type: patched-codes/static-analysis-eval
|
| 32 |
+
name: Static Analysis Eval
|
| 33 |
+
metrics:
|
| 34 |
+
- name: pass@1
|
| 35 |
+
type: pass@1
|
| 36 |
+
value: 51.316
|
| 37 |
+
verified: false
|
| 38 |
+
license: llama2
|
| 39 |
---
|
| 40 |
# Model Card for patched-coder-34b
|
| 41 |
|
|
|
|
| 42 |
This is an instruction fine-tuned model focussed on the task of patching code. Patching may include fixing bugs, remediating security vulnerabilities,
|
| 43 |
doing API migrations and other kinds of code matainence.
|
| 44 |
|
|
|
|
| 113 |
|
| 114 |
## Evaluation
|
| 115 |
|
| 116 |
+
We evaluated the model on `HumanEval` (for code generation) and `HumanEvalFix Python` (for bug fixing) benchmarks using
|
| 117 |
[Code Generation LM Evaluation Harness](https://github.com/bigcode-project/bigcode-evaluation-harness).
|
| 118 |
|
| 119 |
+
To evaluate the model for vulnerability remediation we used the `Static Analysis Eval` benchmark available [here](https://huggingface.co/datasets/patched-codes/static-analysis-eval).
|
| 120 |
|
| 121 |
### Results
|
| 122 |
+
|
| 123 |
+
| Model | HumanEval | HumanEval Fix Python| Static Analysis Eval |
|
| 124 |
+
| ----- | ----------| ------------------- | -------------------- |
|
| 125 |
+
| GPT-4 | 86.6 | 47 | 55.26 |
|
| 126 |
+
| patched-coder-34b | 53.57 | 41.34 | 51.32 |
|
| 127 |
+
| CodeLlama-34b-Python | 53.29 | 33.14 | 27.63 |
|
| 128 |
+
|
| 129 |
+
Based on the results on these benchmarks, patched-coder-34b is the SOTA open code LLM. Other code LLMs (e.g. from WizardCoder and Phind) are trained on
|
| 130 |
+
either unknown proprietary datasets or used OpenAI's APIs for training, thus making them unviable for commercial use.
|