Instructions to use OpenMOSS-Team/moss-base-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenMOSS-Team/moss-base-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OpenMOSS-Team/moss-base-7b", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("OpenMOSS-Team/moss-base-7b", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpenMOSS-Team/moss-base-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenMOSS-Team/moss-base-7b" # 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-base-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/OpenMOSS-Team/moss-base-7b
- SGLang
How to use OpenMOSS-Team/moss-base-7b 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-base-7b" \ --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-base-7b", "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-base-7b" \ --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-base-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use OpenMOSS-Team/moss-base-7b with Docker Model Runner:
docker model run hf.co/OpenMOSS-Team/moss-base-7b
Commit History
-
Fix the code markdown formatting of README
f5a4127
-
Upload generation_config.json with huggingface_hub
e2a7d86 -
Upload pytorch_model-00003-of-00003.bin with huggingface_hub
9856070 -
Upload tokenizer.json with huggingface_hub
26fed5b -
Upload README.md with huggingface_hub
183c257 -
Upload pytorch_model-00002-of-00003.bin with huggingface_hub
1ae8e0f -
Upload pytorch_model-00001-of-00003.bin with huggingface_hub
ee05870 -
Upload special_tokens_map.json with huggingface_hub
f3ae3a0 -
Upload modeling_moss.py with huggingface_hub
435ca9a -
Upload tokenizer_config.json with huggingface_hub
963bed9 -
Upload .gitattributes with huggingface_hub
f6592c7 -
Upload tokenization_moss.py with huggingface_hub
276a169 -
Upload configuration_moss.py with huggingface_hub
8257f52 -
Upload pytorch_model.bin.index.json with huggingface_hub
a42fc81 -
Upload config.json with huggingface_hub
f49bbb7 -
Upload tokenizer.model with huggingface_hub
2fe8853 -
Upload pytorch_model-00001-of-00003.bin with huggingface_hub
55a5117 -
Upload special_tokens_map.json with huggingface_hub
f2c4eb0 -
Upload modeling_moss.py with huggingface_hub
a292541 -
Upload tokenizer_config.json with huggingface_hub
db26452 -
Upload .gitattributes with huggingface_hub
73ec5bd -
Upload tokenization_moss.py with huggingface_hub
c1a661b -
Upload configuration_moss.py with huggingface_hub
2369a37 -
Upload pytorch_model.bin.index.json with huggingface_hub
0ad65b7 -
Upload config.json with huggingface_hub
c2131b2 -
Upload tokenizer.model with huggingface_hub
88410d9 -
Upload pytorch_model-00001-of-00003.bin with huggingface_hub
9027ba8 -
Upload special_tokens_map.json with huggingface_hub
28db130 -
Upload modeling_moss.py with huggingface_hub
787f191 -
Upload tokenizer_config.json with huggingface_hub
c66f55f -
Upload .gitattributes with huggingface_hub
461f4c9 -
Upload tokenization_moss.py with huggingface_hub
91c9edc -
Upload configuration_moss.py with huggingface_hub
68f8d10 -
Upload pytorch_model.bin.index.json with huggingface_hub
182fe68 -
Upload config.json with huggingface_hub
0734ab4 -
Upload tokenizer.model with huggingface_hub
c98ac52 -
Upload tokenizer.json with huggingface_hub
eefeb14 -
Upload README.md with huggingface_hub
a777863 -
Upload pytorch_model-00002-of-00003.bin with huggingface_hub
119ded1 -
Upload pytorch_model-00001-of-00003.bin with huggingface_hub
5589ae6 -
Upload special_tokens_map.json with huggingface_hub
b3bba18 -
Upload modeling_moss.py with huggingface_hub
90b38ec -
Upload tokenizer_config.json with huggingface_hub
e61c521 -
Upload .gitattributes with huggingface_hub
0e9801a -
Upload tokenization_moss.py with huggingface_hub
4fc5e34 -
Upload configuration_moss.py with huggingface_hub
e96ca4f -
Upload pytorch_model.bin.index.json with huggingface_hub
5dc08a6 -
Upload config.json with huggingface_hub
14c8048 -
Upload tokenizer.model with huggingface_hub
03df6c8 -
Upload modeling_moss.py with huggingface_hub
f350120