Conversation
Wq-dd
commented
Dec 4, 2025
- 增加mlu dockerfile
- 增加dockerfile保存目录
Summary of ChangesHello @Wq-dd, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 此拉取请求通过添加一个专用的Dockerfile来引入对Cambricon MLU(机器学习单元)的支持。此外,它还将所有现有的Dockerfile文件重新组织到一个新的 dockerfiles 目录中,从而改进了项目的结构和可维护性。这一更改旨在扩展硬件兼容性并简化Dockerfile的管理。 Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
本次 PR 主要增加了针对寒武纪 MLU 的 Dockerfile,并将所有 Dockerfile 移动到了 dockerfiles 目录下,使项目结构更清晰。
我对新的 dockerfiles/Dockerfile_cambricon_mlu590 文件进行了一些审查,并提出了一些改进建议,主要集中在 Dockerfile 的最佳实践上,例如合并 RUN 指令以减少镜像层数、优化 apt-get 命令等。这些改动有助于减小最终镜像的体积并提高构建效率。
整体来看,这是一个不错的改进,有助于支持新的硬件平台。
| RUN apt install ffmpeg | ||
| RUN pip install --no-cache-dir \ | ||
| ftfy \ | ||
| imageio \ | ||
| imageio-ffmpeg \ | ||
| loguru \ | ||
| aiohttp \ | ||
| gguf \ | ||
| diffusers \ | ||
| peft==0.17.0 \ | ||
| transformers==4.57.1 |
There was a problem hiding this comment.
为了减少 Docker 镜像的层数、减小镜像体积并遵循最佳实践,建议将多个 RUN 指令合并。此外,apt install 应替换为 apt-get update && apt-get install -y --no-install-recommends,以确保获取最新的包索引、在非交互式构建中自动确认,并避免安装非必需的推荐包。安装后清理 apt 缓存也是一个好习惯。
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg && \
pip install --no-cache-dir \
ftfy \
imageio \
imageio-ffmpeg \
loguru \
aiohttp \
gguf \
diffusers \
peft==0.17.0 \
transformers==4.57.1 && \
rm -rf /var/lib/apt/lists/*
| RUN mkdir /workspace/LightX2V | ||
| WORKDIR /workspace/LightX2V |
1. 增加mlu dockerfile 2. 增加dockerfile保存目录