Overseas access: www.kdjingpai.com
Bookmark Us
Current Position:fig. beginning " AI Answers

如何安装和测试Chitu的推理服务?

2025-08-29 1.1 K

安装Chitu推理服务可分为以下步骤:

  1. Get Code:使用git命令克隆仓库git clone --recursive https://github.com/thu-pacman/chituand enter the catalog
  2. Installation of dependencies: Implementationpip install -r requirements-build.txt安装基础依赖包,还需单独安装flash-attn优化组件
  3. compile and install:设置GPU架构参数后编译,如TORCH_CUDA_ARCH_LIST=8.0 CHITU_SETUP_JOBS=4 MAX_JOBS=4 pip install --no-build-isolation .
  4. test and verify: Runtorchrun --nproc_per_node 1 test/single_req_test.py进行基本测试

启动推理服务的具体方法是:

  1. 准备模型文件并确定存放路径
  2. 使用torchrun命令启动服务,指定模型路径和端口:torchrun --nproc_per_node 1 chitu/serve.py serve.port=21002 models=DeepSeek-R1 models.ckpt_dir=/data/DeepSeek-R1
  3. 通过curl发送测试请求:curl localhost:21002/v1/chat/completions -H "Content-Type: application/json" -d '{"messages": [{"role": "user", "content": "你好,Chitu 是什么?"}]}'

如果仅需要单次测试,可以直接运行single_req_test.py脚本而无需启动完整服务。

Recommended

Can't find AI tools? Try here!

Just type in the keyword Accessibility Bing SearchYou can quickly find all the AI tools on this site.

Top

en_USEnglish