Instructions to use opencsg/opencsg-stable-code-3b-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use opencsg/opencsg-stable-code-3b-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="opencsg/opencsg-stable-code-3b-v1", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("opencsg/opencsg-stable-code-3b-v1", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use opencsg/opencsg-stable-code-3b-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "opencsg/opencsg-stable-code-3b-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "opencsg/opencsg-stable-code-3b-v1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/opencsg/opencsg-stable-code-3b-v1
- SGLang
How to use opencsg/opencsg-stable-code-3b-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 "opencsg/opencsg-stable-code-3b-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": "opencsg/opencsg-stable-code-3b-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 "opencsg/opencsg-stable-code-3b-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": "opencsg/opencsg-stable-code-3b-v1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use opencsg/opencsg-stable-code-3b-v1 with Docker Model Runner:
docker model run hf.co/opencsg/opencsg-stable-code-3b-v1
Update README.md
Browse files
README.md
CHANGED
|
@@ -60,10 +60,11 @@ To simplify the comparison, we chosed the Pass@1 metric for the Python language,
|
|
| 60 |
|
| 61 |
| Model | HumanEval python pass@1 |
|
| 62 |
| --- |----------------------------------------------------------------------------- |
|
| 63 |
-
| phi-2 | 48.2% |
|
| 64 |
-
| **opencsg-phi-2-v0.1** |**54.3%**|
|
| 65 |
| stable-coder-3b | 29.3%|
|
| 66 |
| **opencsg-stable-coder-3b-v1**| **46.3%** |
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
|
| 69 |
|
|
@@ -162,10 +163,10 @@ HumanEval 是评估模型在代码生成方面性能的最常见的基准,尤
|
|
| 162 |
|
| 163 |
| 模型 | HumanEval python pass@1 |
|
| 164 |
| --- |----------------------------------------------------------------------------- |
|
| 165 |
-
| phi-2 | 48.2% |
|
| 166 |
-
| **opencsg-phi-2-v0.1** |**54.3%**|
|
| 167 |
| stable-coder-3b | 29.3%|
|
| 168 |
| **opencsg-stable-coder-3b-v1**| **46.3%** |
|
|
|
|
|
|
|
| 169 |
|
| 170 |
|
| 171 |
|
|
|
|
| 60 |
|
| 61 |
| Model | HumanEval python pass@1 |
|
| 62 |
| --- |----------------------------------------------------------------------------- |
|
|
|
|
|
|
|
| 63 |
| stable-coder-3b | 29.3%|
|
| 64 |
| **opencsg-stable-coder-3b-v1**| **46.3%** |
|
| 65 |
+
| phi-2 | 48.2% |
|
| 66 |
+
| **opencsg-phi-2-v0.1** |**54.3%**|
|
| 67 |
+
|
| 68 |
|
| 69 |
|
| 70 |
|
|
|
|
| 163 |
|
| 164 |
| 模型 | HumanEval python pass@1 |
|
| 165 |
| --- |----------------------------------------------------------------------------- |
|
|
|
|
|
|
|
| 166 |
| stable-coder-3b | 29.3%|
|
| 167 |
| **opencsg-stable-coder-3b-v1**| **46.3%** |
|
| 168 |
+
| phi-2 | 48.2% |
|
| 169 |
+
| **opencsg-phi-2-v0.1** |**54.3%**|
|
| 170 |
|
| 171 |
|
| 172 |
|