nuprl/MultiPL-T
Viewer • Updated • 215k • 42 • 8
How to use nuprl/MultiPL-T-StarCoder2_15B with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="nuprl/MultiPL-T-StarCoder2_15B") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("nuprl/MultiPL-T-StarCoder2_15B")
model = AutoModelForCausalLM.from_pretrained("nuprl/MultiPL-T-StarCoder2_15B")How to use nuprl/MultiPL-T-StarCoder2_15B with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "nuprl/MultiPL-T-StarCoder2_15B"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "nuprl/MultiPL-T-StarCoder2_15B",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/nuprl/MultiPL-T-StarCoder2_15B
How to use nuprl/MultiPL-T-StarCoder2_15B with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "nuprl/MultiPL-T-StarCoder2_15B" \
--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": "nuprl/MultiPL-T-StarCoder2_15B",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "nuprl/MultiPL-T-StarCoder2_15B" \
--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": "nuprl/MultiPL-T-StarCoder2_15B",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use nuprl/MultiPL-T-StarCoder2_15B with Docker Model Runner:
docker model run hf.co/nuprl/MultiPL-T-StarCoder2_15B
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("nuprl/MultiPL-T-StarCoder2_15B")
model = AutoModelForCausalLM.from_pretrained("nuprl/MultiPL-T-StarCoder2_15B")This repository holds several StarCoder2-15b fine-tunes, all fine-tuned on MultiPL-T data. Examine the commit message to determine the language and checkpoint. We have a checkpoint for each epoch.
For more information the training process, see the MultiPL-T paper:
@misc{cassano:multipl-t,
title={Knowledge Transfer from High-Resource to Low-Resource Programming Languages for Code LLMs},
author={Federico Cassano and John Gouwar and Francesca Lucchetti and Claire Schlesinger and Anders Freeman and Carolyn Jane Anderson and Molly Q Feldman and Michael Greenberg and Abhinav Jangda and Arjun Guha},
year={2024},
eprint={2308.09895},
archivePrefix={arXiv},
primaryClass={cs.PL}
}
For usage instructions, see the model card for the original model. Replace the model name with the name of this repository, and set revision=COMMIT_HASH.
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nuprl/MultiPL-T-StarCoder2_15B")