Instructions to use OpenMOSS-Team/moss-moon-003-sft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenMOSS-Team/moss-moon-003-sft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OpenMOSS-Team/moss-moon-003-sft", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("OpenMOSS-Team/moss-moon-003-sft", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpenMOSS-Team/moss-moon-003-sft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenMOSS-Team/moss-moon-003-sft" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenMOSS-Team/moss-moon-003-sft", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/OpenMOSS-Team/moss-moon-003-sft
- SGLang
How to use OpenMOSS-Team/moss-moon-003-sft 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 "OpenMOSS-Team/moss-moon-003-sft" \ --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": "OpenMOSS-Team/moss-moon-003-sft", "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 "OpenMOSS-Team/moss-moon-003-sft" \ --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": "OpenMOSS-Team/moss-moon-003-sft", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use OpenMOSS-Team/moss-moon-003-sft with Docker Model Runner:
docker model run hf.co/OpenMOSS-Team/moss-moon-003-sft
Upload added_tokens.json with huggingface_hub
Browse files- added_tokens.json +45 -0
added_tokens.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"\t\t": 106066,
|
| 3 |
+
"\t\t\t": 106065,
|
| 4 |
+
"\t\t\t\t": 106064,
|
| 5 |
+
"\t\t\t\t\t": 106063,
|
| 6 |
+
"\t\t\t\t\t\t": 106062,
|
| 7 |
+
"\t\t\t\t\t\t\t": 106061,
|
| 8 |
+
"\t\t\t\t\t\t\t\t": 106060,
|
| 9 |
+
"\t\t\t\t\t\t\t\t\t": 106059,
|
| 10 |
+
" ": 106058,
|
| 11 |
+
" ": 106057,
|
| 12 |
+
" ": 106056,
|
| 13 |
+
" ": 106055,
|
| 14 |
+
" ": 106054,
|
| 15 |
+
" ": 106053,
|
| 16 |
+
" ": 106052,
|
| 17 |
+
" ": 106051,
|
| 18 |
+
" ": 106050,
|
| 19 |
+
" ": 106049,
|
| 20 |
+
" ": 106048,
|
| 21 |
+
" ": 106047,
|
| 22 |
+
" ": 106046,
|
| 23 |
+
" ": 106045,
|
| 24 |
+
" ": 106044,
|
| 25 |
+
" ": 106043,
|
| 26 |
+
" ": 106042,
|
| 27 |
+
" ": 106041,
|
| 28 |
+
" ": 106040,
|
| 29 |
+
" ": 106039,
|
| 30 |
+
" ": 106038,
|
| 31 |
+
" ": 106037,
|
| 32 |
+
" ": 106036,
|
| 33 |
+
" ": 106035,
|
| 34 |
+
" ": 106034,
|
| 35 |
+
" ": 106033,
|
| 36 |
+
" ": 106032,
|
| 37 |
+
" ": 106031,
|
| 38 |
+
" ": 106030,
|
| 39 |
+
" ": 106029,
|
| 40 |
+
"<eoc>": 106070,
|
| 41 |
+
"<eoh>": 106067,
|
| 42 |
+
"<eom>": 106068,
|
| 43 |
+
"<eor>": 106071,
|
| 44 |
+
"<eot>": 106069
|
| 45 |
+
}
|