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,包含
- 对更改的清晰描述
- 测试结果
- 如果需要,更新文档
需要帮助?
- 查看文档
- 针对错误或功能请求,开启 issue
许可证
通过为 Optimum TPU 贡献代码,您同意您的贡献将根据 Apache License 2.0 版本获得许可。