Text Generation
Transformers
PyTorch
Safetensors
English
code
codegen
Diff Model
causal-lm
code-generation
The Pile
Run this model with HF Jobs
Run CarperAI/diff-codegen-6b-v2 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/CarperAI/diff-codegen-6b-v2. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/CarperAI/diff-codegen-6b-v2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/CarperAI/diff-codegen-6b-v2. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/CarperAI/diff-codegen-6b-v2. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use CarperAI/diff-codegen-6b-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CarperAI/diff-codegen-6b-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CarperAI/diff-codegen-6b-v2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("CarperAI/diff-codegen-6b-v2") model = AutoModelForCausalLM.from_pretrained("CarperAI/diff-codegen-6b-v2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use CarperAI/diff-codegen-6b-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CarperAI/diff-codegen-6b-v2" # 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-6b-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/CarperAI/diff-codegen-6b-v2
- SGLang
How to use CarperAI/diff-codegen-6b-v2 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-6b-v2" \ --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-6b-v2", "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-6b-v2" \ --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-6b-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use CarperAI/diff-codegen-6b-v2 with Docker Model Runner:
docker model run hf.co/CarperAI/diff-codegen-6b-v2
Commit History
-
Adding `safetensors` variant of this model
Verified signatureThis is an automated PR created with https://huggingface.co/spaces/safetensors/convert This new file is equivalent to `pytorch_model.bin` but safe in the sense that no arbitrary code can be put into it. These files also happen to load much faster than their pytorch counterpart: https://colab.research.google.com/github/huggingface/notebooks/blob/main/safetensors_doc/en/speed.ipynb The widgets on your model page will run using this model even if this is not merged making sure the file actually works. If you find any issues: please report here: https://huggingface.co/spaces/safetensors/convert/discussions Feel free to ignore this PR.0306196
-
Add colab link
a73f849
-
Update README.md
633ea75
-
Update README.md
e6318bf
-
Upload LICENSE (#14)
- Upload LICENSE (47c7023eebb50b002a9bdddef9a87c381f381d22)0c40ba3 -
Upload pytorch_model.bin (#8)
- Upload pytorch_model.bin (329ad403afb32352c784fa0a4e070fe10774b459)54aeea1 -
Upload trainer_state.json (#1)
- Upload trainer_state.json (08de088c9342bfcca4c8437380702a466d8d4394)92d64ca -
Upload README.md (#3)
- Upload README.md (568f23e5da0cf35bcb4cd62d4dbbd28c8ebd7c9c)7e530b5 -
Upload added_tokens.json (#4)
- Upload added_tokens.json (7c3ad3846bc357cef20082a789fc7fc51ba545c8)53363ac -
Upload config.json (#5)
- Upload config.json (17ceba7b2a7ada4fe5883e9512b468ab6c9d84b1)f0ced0e -
Upload special_tokens_map.json (#7)
- Upload special_tokens_map.json (4627b6c6fa4e58cfcf87e80b41e36b08d2a12e1c)8fbaac8 -
Upload tokenizer_config.json (#2)
- Upload tokenizer_config.json (5de3bde3ad5c4e3baef20e9f7bb8acfa97baf729)11a0f46 -
Upload vocab.json (#9)
- Upload vocab.json (29459b4f688e9a57564f41609e034fba1da8832f)7a2d225 -
Upload merges.txt (#10)
- Upload merges.txt (59fa60f78c01630da764ce4fd77d1cd8437dfb76)971ec2c -
Upload train_results.json (#13)
- Upload train_results.json (6704a68ff565f898f4f20fd18166ae2413bad66e)1472848 -
Upload tokenizer.json (#12)
- Upload tokenizer.json (bfacb58febddfd9992dc3f37c11407beaca78e00)e7da2ae -
initial commit
ed22db2