Text Generation
Transformers
Safetensors
English
starcoder2
code
starcoder
bigcode
sft
7b
text-generation-inference
Instructions to use abideen/starcoder2-chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use abideen/starcoder2-chat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="abideen/starcoder2-chat")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("abideen/starcoder2-chat") model = AutoModelForCausalLM.from_pretrained("abideen/starcoder2-chat", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use abideen/starcoder2-chat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "abideen/starcoder2-chat" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "abideen/starcoder2-chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/abideen/starcoder2-chat
- SGLang
How to use abideen/starcoder2-chat 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 "abideen/starcoder2-chat" \ --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": "abideen/starcoder2-chat", "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 "abideen/starcoder2-chat" \ --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": "abideen/starcoder2-chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use abideen/starcoder2-chat with Docker Model Runner:
docker model run hf.co/abideen/starcoder2-chat
| license: cc-by-nc-4.0 | |
| base_model: bigcode/starcoder2-7b | |
| language: | |
| - en | |
| library_name: transformers | |
| pipeline_tag: text-generation | |
| tags: | |
| - code | |
| - starcoder | |
| - bigcode | |
| - sft | |
| - 7b | |
| # Starcoder-2-chat | |
|  | |
| <!-- Provide a quick summary of what the model is/does. --> | |
| Starcoder-2-chat is an instruction fine-tuned of [bigcode/starcoder2-7b](https://huggingface.co/bigcode/starcoder2-7b) using the [glaiveai/glaive-code-assistant-v2](https://huggingface.co/datasets/glaiveai/glaive-code-assistant-v2) dataset using LoRA. | |
| ## 🏆 Evaluation results | |
| Thanks to [Muhammad Bin Usman](https://www.linkedin.com/in/muhammad-bin-usman/) for running evals on Starcoder2-chat. | |
| ### HUMANEVAL | |
| 0.3231707317073171 | |
| ### HUMANEVALPLUS | |
| 0.25609756097560976 | |
| ### INSTRUCT-HUMANEVAL | |
| 0.3231707317073171 | |
| ### Training hyperparameters | |
| The following hyperparameters were used during training: | |
| - learning_rate: 5e-7 | |
| - train_batch_size: 2 | |
| - eval_batch_size: Not specified | |
| - seed: Not specified | |
| - gradient_accumulation_steps: 8 | |
| - total_train_batch_size: Not specified | |
| - optimizer: PagedAdamW with 32-bit precision | |
| - lr_scheduler_type: Cosine | |
| - lr_scheduler_warmup_steps: 100 | |
| - training_epoch: 1 | |
| ### Framework versions | |
| - Transformers 4.39.0.dev0 | |
| - Peft 0.9.1.dev0 | |
| - Datasets 2.18.0 | |
| - torch 2.2.0 | |
| - accelerate 0.27.2 |