Instructions to use SenseLLM/ReflectionCoder-CL-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SenseLLM/ReflectionCoder-CL-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SenseLLM/ReflectionCoder-CL-7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SenseLLM/ReflectionCoder-CL-7B") model = AutoModelForCausalLM.from_pretrained("SenseLLM/ReflectionCoder-CL-7B") 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use SenseLLM/ReflectionCoder-CL-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SenseLLM/ReflectionCoder-CL-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SenseLLM/ReflectionCoder-CL-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SenseLLM/ReflectionCoder-CL-7B
- SGLang
How to use SenseLLM/ReflectionCoder-CL-7B 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 "SenseLLM/ReflectionCoder-CL-7B" \ --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": "SenseLLM/ReflectionCoder-CL-7B", "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 "SenseLLM/ReflectionCoder-CL-7B" \ --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": "SenseLLM/ReflectionCoder-CL-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use SenseLLM/ReflectionCoder-CL-7B with Docker Model Runner:
docker model run hf.co/SenseLLM/ReflectionCoder-CL-7B
Houxing Ren commited on
Commit Β·
f00d2a4
1
Parent(s): 5a49989
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
## ReflectionCoder: Learning from Reflection Sequence for Enhanced One-off Code Generation
|
| 2 |
|
| 3 |
<p align="center">
|
|
@@ -18,17 +26,17 @@ ReflectionCoder is a novel approach that effectively leverages reflection sequen
|
|
| 18 |
|
| 19 |
| Model | Checkpoint | Size | HumanEval (+) | MBPP (+) | License|
|
| 20 |
|:-------|:------------|:------|:---------------|:----------|:--------|
|
| 21 |
-
| ReflectionCoder-CL-7B | π€ [HF Link](https://huggingface.co/
|
| 22 |
-
| ReflectionCoder-CL-34B | π€ [HF Link](https://huggingface.co/
|
| 23 |
-
| ReflectionCoder-DS-6.7B | π€ [HF Link](https://huggingface.co/
|
| 24 |
-
| ReflectionCoder-DS-33B | π€ [HF Link](https://huggingface.co/
|
| 25 |
|
| 26 |
## Datasets
|
| 27 |
|
| 28 |
| Dataset | Link | License |
|
| 29 |
|:-------------------|:----------------|:----------------------------------------------|
|
| 30 |
-
| ReflectionSeq-GPT | π€ [HF Link](https://huggingface.co/datasets/
|
| 31 |
-
| ReflectionSeq-DS | π€ [HF Link](https://huggingface.co/datasets/
|
| 32 |
|
| 33 |
|
| 34 |
## How to Use
|
|
@@ -43,7 +51,7 @@ Your Instruction
|
|
| 43 |
```
|
| 44 |
|
| 45 |
#### Inference Code
|
| 46 |
-
Please refer to our GitHub Repo
|
| 47 |
|
| 48 |
## Citation
|
| 49 |
|
|
@@ -69,5 +77,4 @@ We thank the following amazing projects that truly inspired us:
|
|
| 69 |
- [Evol-CodeAlpaca-v1](https://huggingface.co/datasets/theblackcat102/evol-codealpaca-v1)
|
| 70 |
- [MagiCoder](https://github.com/ise-uiuc/magicoder/tree/main)
|
| 71 |
- [EvalPlus](https://github.com/evalplus/evalplus)
|
| 72 |
-
- [OpenCoderInterpreter](https://github.com/OpenCodeInterpreter/OpenCodeInterpreter/tree/main)
|
| 73 |
-
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
datasets:
|
| 4 |
+
- SenseLLM/ReflectionSeq-GPT
|
| 5 |
+
- SenseLLM/ReflectionSeq-DS
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
---
|
| 9 |
## ReflectionCoder: Learning from Reflection Sequence for Enhanced One-off Code Generation
|
| 10 |
|
| 11 |
<p align="center">
|
|
|
|
| 26 |
|
| 27 |
| Model | Checkpoint | Size | HumanEval (+) | MBPP (+) | License|
|
| 28 |
|:-------|:------------|:------|:---------------|:----------|:--------|
|
| 29 |
+
| ReflectionCoder-CL-7B | π€ [HF Link](https://huggingface.co/SenseLLM/ReflectionCoder-CL-7B) | 7B | 75.0 (68.9) | 72.2 (61.4) | [Llama2](https://ai.meta.com/llama/license/) |
|
| 30 |
+
| ReflectionCoder-CL-34B | π€ [HF Link](https://huggingface.co/SenseLLM/ReflectionCoder-CL-34B) | 34B | 70.7 (66.5) | 68.4 (56.6) | [Llama2](https://ai.meta.com/llama/license/) |
|
| 31 |
+
| ReflectionCoder-DS-6.7B | π€ [HF Link](https://huggingface.co/SenseLLM/ReflectionCoder-DS-6.7B) | 6.7B | 80.5 (74.4) | 81.5 (69.6) | [DeepSeek](https://github.com/deepseek-ai/DeepSeek-Coder/blob/main/LICENSE-MODEL) |
|
| 32 |
+
| ReflectionCoder-DS-33B | π€ [HF Link](https://huggingface.co/SenseLLM/ReflectionCoder-DS-33B) | 33B | 82.9 (76.8) | 84.1 (72.0) | [DeepSeek](https://github.com/deepseek-ai/DeepSeek-Coder/blob/main/LICENSE-MODEL) |
|
| 33 |
|
| 34 |
## Datasets
|
| 35 |
|
| 36 |
| Dataset | Link | License |
|
| 37 |
|:-------------------|:----------------|:----------------------------------------------|
|
| 38 |
+
| ReflectionSeq-GPT | π€ [HF Link](https://huggingface.co/datasets/SenseLLM/ReflectionSeq-GPT) | [License](LICENSE) |
|
| 39 |
+
| ReflectionSeq-DS | π€ [HF Link](https://huggingface.co/datasets/SenseLLM/ReflectionSeq-DS) | [License](LICENSE) |
|
| 40 |
|
| 41 |
|
| 42 |
## How to Use
|
|
|
|
| 51 |
```
|
| 52 |
|
| 53 |
#### Inference Code
|
| 54 |
+
Please refer to our [GitHub Repo](https://github.com/SenseLLM/ReflectionCoder) for more technical details.
|
| 55 |
|
| 56 |
## Citation
|
| 57 |
|
|
|
|
| 77 |
- [Evol-CodeAlpaca-v1](https://huggingface.co/datasets/theblackcat102/evol-codealpaca-v1)
|
| 78 |
- [MagiCoder](https://github.com/ise-uiuc/magicoder/tree/main)
|
| 79 |
- [EvalPlus](https://github.com/evalplus/evalplus)
|
| 80 |
+
- [OpenCoderInterpreter](https://github.com/OpenCodeInterpreter/OpenCodeInterpreter/tree/main)
|
|
|