Instructions to use AI4Bread/GouMang with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AI4Bread/GouMang with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AI4Bread/GouMang", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("AI4Bread/GouMang", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AI4Bread/GouMang with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AI4Bread/GouMang" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AI4Bread/GouMang", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AI4Bread/GouMang
- SGLang
How to use AI4Bread/GouMang 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 "AI4Bread/GouMang" \ --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": "AI4Bread/GouMang", "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 "AI4Bread/GouMang" \ --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": "AI4Bread/GouMang", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use AI4Bread/GouMang with Docker Model Runner:
docker model run hf.co/AI4Bread/GouMang
Update README.md
Browse files
README.md
CHANGED
|
@@ -28,6 +28,23 @@
|
|
| 28 |
|
| 29 |
Install the dependencies required for the web demo
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
```bash
|
| 32 |
pip install streamlit==1.24.0
|
| 33 |
```
|
|
|
|
| 28 |
|
| 29 |
Install the dependencies required for the web demo
|
| 30 |
|
| 31 |
+
lmdeploy 没有安装,我们接下来手动安装一下,建议安装最新的稳定版。
|
| 32 |
+
如果是在 InternStudio 开发环境,需要先运行下面的命令,否则会报错。
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
```bash
|
| 36 |
+
# 解决 ModuleNotFoundError: No module named 'packaging' 问题
|
| 37 |
+
pip install packaging
|
| 38 |
+
# 使用 flash_attn 的预编译包解决安装过慢问题
|
| 39 |
+
pip install /root/share/wheels/flash_attn-2.4.2+cu118torch2.0cxx11abiTRUE-cp310-cp310-linux_x86_64.whl
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
```bash
|
| 43 |
+
pip install 'lmdeploy[all]==v0.4.2'
|
| 44 |
+
```
|
| 45 |
+
由于默认安装的是 runtime 依赖包,但是我们这里还需要部署和量化,所以,这里选择 `[all]`。
|
| 46 |
+
|
| 47 |
+
|
| 48 |
```bash
|
| 49 |
pip install streamlit==1.24.0
|
| 50 |
```
|