Run this model with HF Jobs
Run wyt2000/InverseCoder-CL-13B 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/wyt2000/InverseCoder-CL-13B. 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/wyt2000/InverseCoder-CL-13B 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/wyt2000/InverseCoder-CL-13B. 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/wyt2000/InverseCoder-CL-13B. 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 wyt2000/InverseCoder-CL-13B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use wyt2000/InverseCoder-CL-13B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="wyt2000/InverseCoder-CL-13B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("wyt2000/InverseCoder-CL-13B") model = AutoModelForCausalLM.from_pretrained("wyt2000/InverseCoder-CL-13B", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use wyt2000/InverseCoder-CL-13B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "wyt2000/InverseCoder-CL-13B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wyt2000/InverseCoder-CL-13B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/wyt2000/InverseCoder-CL-13B
- SGLang
How to use wyt2000/InverseCoder-CL-13B 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 "wyt2000/InverseCoder-CL-13B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wyt2000/InverseCoder-CL-13B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "wyt2000/InverseCoder-CL-13B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wyt2000/InverseCoder-CL-13B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use wyt2000/InverseCoder-CL-13B with Docker Model Runner:
docker model run hf.co/wyt2000/InverseCoder-CL-13B
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 "wyt2000/InverseCoder-CL-13B" \
--host 0.0.0.0 \
--port 30000# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "wyt2000/InverseCoder-CL-13B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'
InverseCoder: Unleashing the Power of Instruction-Tuned Code LLMs with Inverse-Instruct
InverseCoder is a series of code LLMs instruction-tuned by generating data from itself through Inverse-Instruct.
Models and Datasets
Usage
Similar to Magicoder-S-DS-6.7B, use the code below to get started with the model. Make sure you installed the transformers library.
from transformers import pipeline
import torch
INVERSECODER_PROMPT = """You are an exceptionally intelligent coding assistant that consistently delivers accurate and reliable responses to user instructions.
@@ Instruction
{instruction}
@@ Response
"""
instruction = <Your code instruction here>
prompt = INVERSECODER_PROMPT.format(instruction=instruction)
generator = pipeline(
model="wyt2000/InverseCoder-CL-13B",
task="text-generation",
torch_dtype=torch.bfloat16,
device_map="auto",
)
result = generator(prompt, max_length=1024, num_return_sequences=1, temperature=0.0)
print(result[0]["generated_text"])
Paper
Arxiv: https://arxiv.org/abs/2407.05700
Please cite the paper if you use the models or datasets from InverseCoder.
@misc{wu2024inversecoderunleashingpowerinstructiontuned,
title={InverseCoder: Unleashing the Power of Instruction-Tuned Code LLMs with Inverse-Instruct},
author={Yutong Wu and Di Huang and Wenxuan Shi and Wei Wang and Lingzhe Gao and Shihao Liu and Ziyuan Nan and Kaizhao Yuan and Rui Zhang and Xishan Zhang and Zidong Du and Qi Guo and Yewen Pu and Dawei Yin and Xing Hu and Yunji Chen},
year={2024},
eprint={2407.05700},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2407.05700},
}
Code
Official code repo for Inverse-Instruct (under development).
Acknowledgements
- Magicoder: Training code, original datasets and data decontamination
- DeepSeek-Coder: Base model for InverseCoder-DS
- CodeLlama: Base model for InverseCoder-CL
- AutoMathText: Self-evaluation and data selection method
- Downloads last month
- 10
Model tree for wyt2000/InverseCoder-CL-13B
Datasets used to train wyt2000/InverseCoder-CL-13B
wyt2000/InverseCoder-CL-13B-Evol-Instruct-90K
Collection including wyt2000/InverseCoder-CL-13B
Paper for wyt2000/InverseCoder-CL-13B
Evaluation results
- pass@1 on HumanEvalself-reported0.799
- pass@1 on HumanEval(+)self-reported0.744
- pass@1 on MBPPself-reported0.746
- pass@1 on MBPP(+)self-reported0.630
- pass@1 on DS-1000 (Overall Completion)self-reported0.431
- pass@1 on MultiPL-HumanEval (Java)self-reported0.545
- pass@1 on MultiPL-HumanEval (JavaScript)self-reported0.654
- pass@1 on MultiPL-HumanEval (C++)self-reported0.581
Install from pip and serve model
# Install SGLang from pip: pip install sglang# Start the SGLang server: python3 -m sglang.launch_server \ --model-path "wyt2000/InverseCoder-CL-13B" \ --host 0.0.0.0 \ --port 30000# Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wyt2000/InverseCoder-CL-13B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'