Text Generation
Transformers
PyTorch
English
code
codegen
Diff Model
causal-lm
code-generation
The Pile
Run this model with HF Jobs
Run CarperAI/diff-codegen-350m-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-350m-v2. Ask me which dataset to train on, then push the LoRA adapter to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs and Transformers to run batch inference with https://huggingface.co/CarperAI/diff-codegen-350m-v2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the predictions back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs and Lighteval to evaluate https://huggingface.co/CarperAI/diff-codegen-350m-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-350m-v2 with Transformers and bitsandbytes. 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-350m-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CarperAI/diff-codegen-350m-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CarperAI/diff-codegen-350m-v2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("CarperAI/diff-codegen-350m-v2") model = AutoModelForCausalLM.from_pretrained("CarperAI/diff-codegen-350m-v2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use CarperAI/diff-codegen-350m-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-350m-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-350m-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/CarperAI/diff-codegen-350m-v2
- SGLang
How to use CarperAI/diff-codegen-350m-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-350m-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-350m-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-350m-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-350m-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use CarperAI/diff-codegen-350m-v2 with Docker Model Runner:
docker model run hf.co/CarperAI/diff-codegen-350m-v2
Commit History
-
Add colab link
2afdf75
-
Update README.md
65aab31
-
Update README.md
b3c225b -
Update README.md
8806fce -
Update README.md
a52cb6f
-
Upload pytorch_model.bin (#5)
- Upload pytorch_model.bin (18d7ca7e3d80692537c882745929a29bfddfa963)852b017 -
Upload vocab.json (#2)
- Upload vocab.json (458646ea64fd10c4c4f3208f32a0e77eec1956ee)30c5e58 -
Upload merges.txt (#3)
- Upload merges.txt (cf01b12b743724acfc022264746a4ca94e8fc7a3)f95c092 -
Upload train_results.json (#4)
- Upload train_results.json (80f94abc1174bc4a892cbc2ab4cd14d509c282aa)865cbf4 -
Upload tokenizer_config.json (#6)
- Upload tokenizer_config.json (592a2aeda0f3826e5d11c8307cc1bd344cebbfe8)a94da45 -
Upload config.json (#7)
- Upload config.json (c2047f0a793e4e5dc5ee228a2a48045b5e7d4ac4)d76cd04 -
Upload added_tokens.json (#8)
- Upload added_tokens.json (92df71bcb5fb4a817f4608ea670b433c0c27e29d)57bb8c6 -
Upload README.md (#9)
- Upload README.md (f1029b45144d6a65b4b7ee645bfebb3055163ee9)7f559cc -
Upload special_tokens_map.json (#10)
- Upload special_tokens_map.json (15669087c9300a41ec360dd8971e032842d009cf)50d717e -
Upload trainer_state.json (#11)
- Upload trainer_state.json (7b4799c3d1fc70c770cbda94830094ecd6c1702b)ee132ba -
Upload LICENSE (#12)
- Upload LICENSE (4d0cfc8963de267eb831480d35d2fb5a39b0dd38)210647e -
Upload tokenizer.json (#13)
- Upload tokenizer.json (1c4b737892849be9234c354a847a7d64f6260072)af88812 -
initial commit
12c8708