Instructions to use shpotes/codegen-350M-mono with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use shpotes/codegen-350M-mono with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="shpotes/codegen-350M-mono")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("shpotes/codegen-350M-mono") model = AutoModelForCausalLM.from_pretrained("shpotes/codegen-350M-mono") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use shpotes/codegen-350M-mono with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "shpotes/codegen-350M-mono" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shpotes/codegen-350M-mono", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/shpotes/codegen-350M-mono
- SGLang
How to use shpotes/codegen-350M-mono 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 "shpotes/codegen-350M-mono" \ --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": "shpotes/codegen-350M-mono", "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 "shpotes/codegen-350M-mono" \ --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": "shpotes/codegen-350M-mono", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use shpotes/codegen-350M-mono with Docker Model Runner:
docker model run hf.co/shpotes/codegen-350M-mono
add tokenizer
Browse files- added_tokens.json +1 -1
- special_tokens_map.json +1 -1
- tokenizer.json +9 -0
added_tokens.json
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"
|
|
|
|
| 1 |
+
{" ": 50283, " ": 50271, "\t\t": 50304, "\t\t\t\t\t\t\t\t\t": 50297, " ": 50264, " ": 50275, "\t\t\t\t": 50302, " ": 50284, " ": 50261, " ": 50270, " ": 50274, "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t": 50288, "\t\t\t\t\t\t\t": 50299, "\t\t\t\t\t\t\t\t\t\t\t\t": 50294, " ": 50280, " ": 50263, "\t\t\t\t\t": 50301, " ": 50268, " ": 50269, " ": 50257, " ": 50259, "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t": 50287, " ": 50282, " ": 50281, " ": 50260, "\t\t\t": 50303, "\t\t\t\t\t\t\t\t\t\t": 50296, " ": 50272, " ": 50279, "<pad>": 50305, "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t": 50291, " ": 50286, "\t\t\t\t\t\t\t\t\t\t\t": 50295, " ": 50266, "\t\t\t\t\t\t\t\t\t\t\t\t\t\t": 50292, " ": 50267, " ": 50273, "\t\t\t\t\t\t": 50300, " ": 50285, "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t": 50290, " ": 50278, "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t": 50289, " ": 50262, " ": 50258, " ": 50265, " ": 50276, "\t\t\t\t\t\t\t\t": 50298, "\t\t\t\t\t\t\t\t\t\t\t\t\t": 50293, " ": 50277}
|
special_tokens_map.json
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"bos_token": "<|endoftext|>", "eos_token": "<|endoftext|>", "unk_token": "<|endoftext|>"}
|
|
|
|
| 1 |
+
{"bos_token": "<|endoftext|>", "eos_token": "<|endoftext|>", "unk_token": "<|endoftext|>", "pad_token": "<pad>"}
|
tokenizer.json
CHANGED
|
@@ -443,6 +443,15 @@
|
|
| 443 |
"rstrip": false,
|
| 444 |
"normalized": true,
|
| 445 |
"special": false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 446 |
}
|
| 447 |
],
|
| 448 |
"normalizer": null,
|
|
|
|
| 443 |
"rstrip": false,
|
| 444 |
"normalized": true,
|
| 445 |
"special": false
|
| 446 |
+
},
|
| 447 |
+
{
|
| 448 |
+
"id": 50305,
|
| 449 |
+
"content": "<pad>",
|
| 450 |
+
"single_word": false,
|
| 451 |
+
"lstrip": false,
|
| 452 |
+
"rstrip": false,
|
| 453 |
+
"normalized": false,
|
| 454 |
+
"special": true
|
| 455 |
}
|
| 456 |
],
|
| 457 |
"normalizer": null,
|