Instructions to use budecosystem/code-millenials-3b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use budecosystem/code-millenials-3b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="budecosystem/code-millenials-3b", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("budecosystem/code-millenials-3b", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("budecosystem/code-millenials-3b", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use budecosystem/code-millenials-3b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "budecosystem/code-millenials-3b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "budecosystem/code-millenials-3b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/budecosystem/code-millenials-3b
- SGLang
How to use budecosystem/code-millenials-3b 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 "budecosystem/code-millenials-3b" \ --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": "budecosystem/code-millenials-3b", "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 "budecosystem/code-millenials-3b" \ --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": "budecosystem/code-millenials-3b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use budecosystem/code-millenials-3b with Docker Model Runner:
docker model run hf.co/budecosystem/code-millenials-3b
Update boomer_code_tokenizer.py
Browse filesFix tokenizer for transformers >= 4.34
From https://github.com/InternLM/InternLM/pull/419
- boomer_code_tokenizer.py +1 -1
boomer_code_tokenizer.py
CHANGED
|
@@ -63,10 +63,10 @@ class BoomerCodeTokenizer(PreTrainedTokenizer):
|
|
| 63 |
|
| 64 |
def __init__(self, vocab_file, bos_token=None, eos_token='<|endoftext|>', unk_token='<|unk|>', pad_token='<|pad|>', sep_token=None, sp_model_kwargs: Optional[Dict[str, Any]]=None, **kwargs) -> None:
|
| 65 |
self.sp_model_kwargs = {} if sp_model_kwargs is None else sp_model_kwargs
|
| 66 |
-
super().__init__(bos_token=bos_token, eos_token=eos_token, unk_token=unk_token, pad_token=pad_token, sep_token=sep_token, sp_model_kwargs=self.sp_model_kwargs, **kwargs)
|
| 67 |
self.vocab_file = vocab_file
|
| 68 |
self.sp_model = spm.SentencePieceProcessor(**self.sp_model_kwargs)
|
| 69 |
self.sp_model.Load(vocab_file)
|
|
|
|
| 70 |
|
| 71 |
print(self.sp_model)
|
| 72 |
|
|
|
|
| 63 |
|
| 64 |
def __init__(self, vocab_file, bos_token=None, eos_token='<|endoftext|>', unk_token='<|unk|>', pad_token='<|pad|>', sep_token=None, sp_model_kwargs: Optional[Dict[str, Any]]=None, **kwargs) -> None:
|
| 65 |
self.sp_model_kwargs = {} if sp_model_kwargs is None else sp_model_kwargs
|
|
|
|
| 66 |
self.vocab_file = vocab_file
|
| 67 |
self.sp_model = spm.SentencePieceProcessor(**self.sp_model_kwargs)
|
| 68 |
self.sp_model.Load(vocab_file)
|
| 69 |
+
super().__init__(bos_token=bos_token, eos_token=eos_token, unk_token=unk_token, pad_token=pad_token, sep_token=sep_token, sp_model_kwargs=self.sp_model_kwargs, **kwargs)
|
| 70 |
|
| 71 |
print(self.sp_model)
|
| 72 |
|