diff --git a/sources/llamafactory/example.rst b/sources/llamafactory/example.rst index c2023be..9f3589f 100644 --- a/sources/llamafactory/example.rst +++ b/sources/llamafactory/example.rst @@ -187,7 +187,10 @@ LoRA 模型合并和导出时,可通过指定 ``export_device`` 参数为 ``au 在 webui 实现 Qwen1.5-7B 模型的 LoRA 模型微调、动态推理和模型导出的操作示例: -TODO: 视频上传至 B 站后放链接 +.. raw:: html + + + API Server的启动与调用 -------------------------- diff --git a/sources/llamafactory/install.rst b/sources/llamafactory/install.rst index 6eb6b77..9d0e6e8 100644 --- a/sources/llamafactory/install.rst +++ b/sources/llamafactory/install.rst @@ -35,8 +35,8 @@
创建并激活 Python 环境:
conda create -n python=3.10
- conda activate
+ conda create -n your_env_name python=3.10
+ conda activate your_env_name
提示
默认镜像为cosdt/cann:8.0.rc1-910b-ubuntu22.04。更多选择见cosdt/cann。
+此处提供使用 docker-compose 构建及启动 docker 容器和不使用 docker-compose 两种构建方式,请根据需求选择其一。
+进入存放 Dockerfile 及 docker-compose.yaml 的 docker-npu 目录:
cd docker/docker-npu
使用以下指令构建及启动 docker 容器:
+构建 docker 镜像并启动 docker 容器:
docker build -f ./Dockerfile --build-arg INSTALL_DEEPSPEED=false --build-arg PIP_INDEX=https://pypi.org/simple -t llamafactory:latest
+ docker-compose up -d
进入 docker 容器:
+docker exec -it llamafactory bash
+ 构建 docker 镜像:
+docker build -f ./docker/docker-npu/Dockerfile --build-arg INSTALL_DEEPSPEED=false --build-arg PIP_INDEX=https://pypi.org/simple -t llamafactory:latest .
+ 启动 docker 容器:
+docker run -dit \
+ -v ./hf_cache:/root/.cache/huggingface \
+ -v ./ms_cache:/root/.cache/modelscope \
+ -v ./data:/app/data \
+ -v ./output:/app/output \
+ -v /usr/local/dcmi:/usr/local/dcmi \
+ -v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \
+ -v /usr/local/Ascend/driver:/usr/local/Ascend/driver \
+ -v /etc/ascend_install.info:/etc/ascend_install.info \
+ -p 7860:7860 \
+ -p 8000:8000 \
+ --device /dev/davinci0 \
+ --device /dev/davinci_manager \
+ --device /dev/devmm_svm \
+ --device /dev/hisi_hdc \
+ --shm-size 16G \
+ --name llamafactory \
+ llamafactory:latest
+ 进入 docker 容器:
+docker exec -it llamafactory bash
+