Instructions to use chgk13/stablecode-completion-alpha-3b-4k-openvino-int8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use chgk13/stablecode-completion-alpha-3b-4k-openvino-int8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="chgk13/stablecode-completion-alpha-3b-4k-openvino-int8")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("chgk13/stablecode-completion-alpha-3b-4k-openvino-int8") model = AutoModelForCausalLM.from_pretrained("chgk13/stablecode-completion-alpha-3b-4k-openvino-int8") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use chgk13/stablecode-completion-alpha-3b-4k-openvino-int8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "chgk13/stablecode-completion-alpha-3b-4k-openvino-int8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "chgk13/stablecode-completion-alpha-3b-4k-openvino-int8", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/chgk13/stablecode-completion-alpha-3b-4k-openvino-int8
- SGLang
How to use chgk13/stablecode-completion-alpha-3b-4k-openvino-int8 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 "chgk13/stablecode-completion-alpha-3b-4k-openvino-int8" \ --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": "chgk13/stablecode-completion-alpha-3b-4k-openvino-int8", "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 "chgk13/stablecode-completion-alpha-3b-4k-openvino-int8" \ --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": "chgk13/stablecode-completion-alpha-3b-4k-openvino-int8", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use chgk13/stablecode-completion-alpha-3b-4k-openvino-int8 with Docker Model Runner:
docker model run hf.co/chgk13/stablecode-completion-alpha-3b-4k-openvino-int8
Upload openvino_config.json with huggingface_hub
Browse files- openvino_config.json +35 -0
openvino_config.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"compression": {
|
| 3 |
+
"algorithm": "quantization",
|
| 4 |
+
"export_to_onnx_standard_ops": false,
|
| 5 |
+
"ignored_scopes": [
|
| 6 |
+
"{re}.*Embedding.*",
|
| 7 |
+
"{re}.*add___.*",
|
| 8 |
+
"{re}.*layer_norm_.*",
|
| 9 |
+
"{re}.*matmul_1",
|
| 10 |
+
"{re}.*__truediv__.*"
|
| 11 |
+
],
|
| 12 |
+
"initializer": {
|
| 13 |
+
"batchnorm_adaptation": {
|
| 14 |
+
"num_bn_adaptation_samples": 0
|
| 15 |
+
},
|
| 16 |
+
"range": {
|
| 17 |
+
"num_init_samples": 300,
|
| 18 |
+
"type": "mean_min_max"
|
| 19 |
+
}
|
| 20 |
+
},
|
| 21 |
+
"overflow_fix": "disable",
|
| 22 |
+
"preset": "mixed",
|
| 23 |
+
"scope_overrides": {
|
| 24 |
+
"activations": {
|
| 25 |
+
"{re}.*matmul_0": {
|
| 26 |
+
"mode": "symmetric"
|
| 27 |
+
}
|
| 28 |
+
}
|
| 29 |
+
}
|
| 30 |
+
},
|
| 31 |
+
"input_info": null,
|
| 32 |
+
"optimum_version": "1.10.0",
|
| 33 |
+
"save_onnx_model": false,
|
| 34 |
+
"transformers_version": "4.32.0.dev0"
|
| 35 |
+
}
|