Instructions to use johnwee1/starcoder-1b-python with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use johnwee1/starcoder-1b-python with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="johnwee1/starcoder-1b-python")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("johnwee1/starcoder-1b-python") model = AutoModelForCausalLM.from_pretrained("johnwee1/starcoder-1b-python", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use johnwee1/starcoder-1b-python with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "johnwee1/starcoder-1b-python" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "johnwee1/starcoder-1b-python", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/johnwee1/starcoder-1b-python
- SGLang
How to use johnwee1/starcoder-1b-python 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 "johnwee1/starcoder-1b-python" \ --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": "johnwee1/starcoder-1b-python", "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 "johnwee1/starcoder-1b-python" \ --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": "johnwee1/starcoder-1b-python", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use johnwee1/starcoder-1b-python with Docker Model Runner:
docker model run hf.co/johnwee1/starcoder-1b-python
Download tokenizer.json from johnwee1/starcoder-1b-python: direct link, hf CLI and curl.
- Browser
- Download file 2.06 MB
-
https://huggingface.co/johnwee1/starcoder-1b-python/resolve/4b792f1a0bb209278f3cf211daa304b6107a33c6/tokenizer.json
- Command line
-
hf download hf://johnwee1/starcoder-1b-python@4b792f1a0bb209278f3cf211daa304b6107a33c6/tokenizer.json
-
curl -L -o tokenizer.json https://huggingface.co/johnwee1/starcoder-1b-python/resolve/4b792f1a0bb209278f3cf211daa304b6107a33c6/tokenizer.json
2.06 MB
File too large to display, you can check the raw version instead.