Instructions to use ZhouBencheng/9G4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ZhouBencheng/9G4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ZhouBencheng/9G4B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("ZhouBencheng/9G4B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ZhouBencheng/9G4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ZhouBencheng/9G4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ZhouBencheng/9G4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ZhouBencheng/9G4B
- SGLang
How to use ZhouBencheng/9G4B 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 "ZhouBencheng/9G4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ZhouBencheng/9G4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "ZhouBencheng/9G4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ZhouBencheng/9G4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ZhouBencheng/9G4B with Docker Model Runner:
docker model run hf.co/ZhouBencheng/9G4B
九格 FM9G-4B(官方权重社区镜像)
本仓库由 ZhouBencheng 维护,镜像官方公开的 9G4B.tar。原始归档中的 10 个文件保持原始字节;本镜像没有修改或转换权重及配套代码。
- 官方项目:OSRedm / CPM-9G-8B
- 原始归档:华为云 9G4B.tar
- 归档大小:9,239,613,440 bytes
- 归档 SHA256:
28ff0bad05c04b97433c57de1ed2aef0ccd233536e260773a4a9e7482b6db89c
原包 config.json 声明架构为 FM9GForCausalLM,max_position_embeddings 为 4096,torch_dtype 为 bfloat16。原包附带 configuration_fm9g.py、modeling_fm9g.py 和 infer_demo.py,使用其自定义模型代码。
MODEL_SOURCE.json 记录原始文件的大小与 SHA256。README.md、LICENSE 和 MODEL_SOURCE.json 是镜像新增文件,不属于原始归档。LICENSE 来自官方项目,保留 Copyright 2024 QiyuanLab 及 Apache License 2.0 原文。
- Downloads last month
- 179