Instructions to use stillerman/santacoder-ruby with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use stillerman/santacoder-ruby with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="stillerman/santacoder-ruby", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("stillerman/santacoder-ruby", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("stillerman/santacoder-ruby", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use stillerman/santacoder-ruby with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "stillerman/santacoder-ruby" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "stillerman/santacoder-ruby", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/stillerman/santacoder-ruby
- SGLang
How to use stillerman/santacoder-ruby 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 "stillerman/santacoder-ruby" \ --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": "stillerman/santacoder-ruby", "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 "stillerman/santacoder-ruby" \ --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": "stillerman/santacoder-ruby", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use stillerman/santacoder-ruby with Docker Model Runner:
docker model run hf.co/stillerman/santacoder-ruby
Commit ·
778a985
1
Parent(s): 83d6fca
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## Model
|
| 2 |
+
This model is a fine-tuned version of [BigCode/SantaCoder](https://huggingface.co/bigcode/santacoder) on the Ruby portion of [The Stack](https://huggingface.co/datasets/bigcode/the-stack-dedup).
|
| 3 |
+
|
| 4 |
+
## Training
|
| 5 |
+
This model was trained using character-level FIM with [this script](https://github.com/Stillerman/santacoder-finetuning) invoked like this
|
| 6 |
+
```
|
| 7 |
+
train.py --model_path=bigcode/santacoder --dataset_name=bigcode/the-stack-dedup \
|
| 8 |
+
--subset=data/ruby --data_column content --split=train \
|
| 9 |
+
--seq_length 2048 --max_steps 4000 --batch_size 3 \
|
| 10 |
+
--gradient_accumulation_steps 8 --learning_rate 5e-5 \
|
| 11 |
+
--num_warmup_steps 500 --eval_freq 1000 --save_freq 1000 \
|
| 12 |
+
--log_freq 1 --num_workers=12 --no_fp16 --streaming \
|
| 13 |
+
--fim_rate=0.5 --fim_spm_rate=0.5
|
| 14 |
+
```
|
| 15 |
+
|
| 16 |
+
on a 40GB A100 for 48 hours.
|
| 17 |
+
|
| 18 |
+
## Performance
|
| 19 |
+
|
| 20 |
+
[MultiPL-E](https://nuprl.github.io/MultiPL-E/) HumanEval Ruby pass@1 = 0.10
|