Text Generation
Transformers
PyTorch
English
code
codegen
Diff Model
causal-lm
code-generation
The Pile
Instructions to use CarperAI/diff-codegen-350m-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CarperAI/diff-codegen-350m-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CarperAI/diff-codegen-350m-v1")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("CarperAI/diff-codegen-350m-v1") model = AutoModelForCausalLM.from_pretrained("CarperAI/diff-codegen-350m-v1") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use CarperAI/diff-codegen-350m-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CarperAI/diff-codegen-350m-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CarperAI/diff-codegen-350m-v1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/CarperAI/diff-codegen-350m-v1
- SGLang
How to use CarperAI/diff-codegen-350m-v1 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 "CarperAI/diff-codegen-350m-v1" \ --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": "CarperAI/diff-codegen-350m-v1", "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 "CarperAI/diff-codegen-350m-v1" \ --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": "CarperAI/diff-codegen-350m-v1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use CarperAI/diff-codegen-350m-v1 with Docker Model Runner:
docker model run hf.co/CarperAI/diff-codegen-350m-v1
Add multilingual to the language tag
#6
by lbourdois - opened
README.md
CHANGED
|
@@ -1,10 +1,9 @@
|
|
| 1 |
---
|
| 2 |
-
language:
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
license:
|
| 7 |
-
|
| 8 |
tags:
|
| 9 |
- Diff Model
|
| 10 |
- pytorch
|
|
@@ -15,7 +14,7 @@ tags:
|
|
| 15 |
|
| 16 |
**Model Description**
|
| 17 |
|
| 18 |
-
Diff-Codegen-350M is the first in a series of diff models released by CarperAI. A diff model is an autoregressive language model trained on edits to a piece of text, formatted in Unified Diff Format. These diff models can suggest, given a section of text and a description of the desired change, an intelligent change to the text that fits the description, marking the lines added, changed, and deleted in diff format. The primary use case for these models is for suggesting changes to code
|
| 19 |
|
| 20 |
Diff-Codegen-350M-v1 is an initial preliminary release of an experimental artifact and should be treated as such. We are releasing these results and this model in the hopes that it may be useful to the greater research community, especially those interested in LMs for code.
|
| 21 |
|
|
@@ -44,7 +43,7 @@ Each file was formatted as follows for input to the language model:
|
|
| 44 |
|
| 45 |
**Intended Uses and Limitations**
|
| 46 |
|
| 47 |
-
Due to the model
|
| 48 |
|
| 49 |
**Limitations and Biases**
|
| 50 |
|
|
@@ -63,4 +62,4 @@ This model is licensed as MIT. While it can be used in commercial settings, we d
|
|
| 63 |
|
| 64 |
**Acknowledgements**
|
| 65 |
|
| 66 |
-
We
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
- code
|
| 5 |
+
- multilingual
|
| 6 |
+
license: mit
|
|
|
|
| 7 |
tags:
|
| 8 |
- Diff Model
|
| 9 |
- pytorch
|
|
|
|
| 14 |
|
| 15 |
**Model Description**
|
| 16 |
|
| 17 |
+
Diff-Codegen-350M is the first in a series of diff models released by CarperAI. A diff model is an autoregressive language model trained on edits to a piece of text, formatted in Unified Diff Format. These diff models can suggest, given a section of text and a description of the desired change, an intelligent change to the text that fits the description, marking the lines added, changed, and deleted in diff format. The primary use case for these models is for suggesting changes to code�as such, most models we release will be fine-tuned versions of models trained on code datasets.
|
| 18 |
|
| 19 |
Diff-Codegen-350M-v1 is an initial preliminary release of an experimental artifact and should be treated as such. We are releasing these results and this model in the hopes that it may be useful to the greater research community, especially those interested in LMs for code.
|
| 20 |
|
|
|
|
| 43 |
|
| 44 |
**Intended Uses and Limitations**
|
| 45 |
|
| 46 |
+
Due to the model�s small size and restriction to code, one should not expect the model to generalize to domains beyond code and perform (successful) reasoning over large chunks of code. This model is intended to be used in prototyping ELM-like systems, and for solely experimental purposes. This model is provided without warranty and should not be used in commercial settings -- even though the license permits.
|
| 47 |
|
| 48 |
**Limitations and Biases**
|
| 49 |
|
|
|
|
| 62 |
|
| 63 |
**Acknowledgements**
|
| 64 |
|
| 65 |
+
We�d like to thank Honglu Fan, Harry Saini, Herbie Bradley, and Joel Lehman
|