optimum-tpu 文档
为 Optimum TPU 贡献
加入 Hugging Face 社区
并获得增强的文档体验
开始使用
贡献 Optimum TPU
我们很高兴您有兴趣为 Optimum TPU 贡献力量!无论是修复错误、添加新功能、改进文档还是分享您的经验,您的贡献都将受到高度重视 😄
开始
- Fork 并克隆仓库
git clone https://github.com/YOUR_USERNAME/optimum-tpu.git
cd optimum-tpu
- 在本地安装软件包
python -m venv .venv
source .venv/bin/activate
python -m pip install . -f https://storage.googleapis.com/libtpu-releases/index.html
开发工具
项目包含一个全面的 Makefile,其中包含各种开发任务的命令
测试
make tests # Run all the non-TGI-related tests
make tgi_test # Run TGI tests with PyTorch/XLA
make tgi_test_jetstream # Run TGI tests with Jetstream backend
make tgi_docker_test # Run TGI integration tests in Docker
代码质量
make style # Auto-fix code style issues
make style_check # Check code style without fixing
文档
make preview_doc # Preview documentation locally
Docker 镜像
make tpu-tgi # Build TGI Docker image
make tpu-tgi-ie # Build TGI inference endpoint image
make tpu-tgi-gcp # Build TGI Google Cloud image
TGI 开发
在进行文本生成推理(`text-generation-inference` 文件夹)时,您可能还需要从头开始构建 TGI 镜像。为此,请参阅服务操作指南中的手动镜像构建部分
- 构建独立服务器
make tgi_server
拉取请求流程
- 创建新分支
git checkout -b your-feature-name
进行更改
运行测试
make tests
# Run more specialized test if needed such as make tgi_test, make tgi_test_jetstream, make tgi_docker_test
make style_check
- 提交您的 PR 并附上
- 清晰的更改描述
- 测试结果
- 必要时更新文档
需要帮助?
- 查看文档
- 针对 bug 或功能请求提出问题
许可证
通过贡献 Optimum TPU,您同意您的贡献将根据 Apache 许可证 2.0 版获得许可。