ZeroGPU 应用优化
原名:huggingface-zerogpu
为 Hugging Face ZeroGPU 环境调整 GPU 函数、队列与资源使用。
中文 Skills 技能说明
适合符合平台规则的低成本 Space 演示;先核对配额、装饰器、超时和并发限制,不能承诺资源一定可用。开源工具可以本地使用;访问 Hugging Face Hub、Spaces、ZeroGPU、AWS 或托管服务时,用户需自行确认中国大陆网络、账户、区域、费用、模型与数据许可证及跨境要求。执行前应读取项目现状和官方文档,输出目标、依据、影响、验证结果与回退方式;没有真实证据时明确说明未知,不编造配置、数据或成功状态。 创建、修改、训练、部署、发布、迁移、删除或产生费用的操作,必须先展示具体目标和差异并获得人工确认。 代码、日志、令牌、连接串、模型、数据集和企业资料按敏感内容处理,只读取任务所需范围,上传或外发前完成授权、脱敏和最小化。
上游能力依据
上游原始适用说明:AI demos and GPU compute with Gradio Spaces and Hugging Face Spaces ZeroGPU. Use when writing or reviewing code that uses @spaces.GPU, configuring pythonversion or requirements.txt for a ZeroGPU Space, or handling ZeroGPU-specific code constraints — pickle-based process isolation, gr.State semantics across the worker boundary, no torch.compile (use AoTI instead), CUDA wheel-only builds (no nvcc at build or runtime), large vs xlarge sizing, and dynamic duration callables. Make sure to use this skill whenever the user mentions ZeroGPU, @spaces.GPU, or the spaces Python package, or hits ZeroGPU-specific code errors like PicklingError across the worker boundary, illegal duration, or flash-attn wheel-build failures — even when the user does not explicitly ask for ZeroGPU coding guidance. Trigger on import spaces or @spaces.GPU in code.
上游 SKILL.md 主要章节(保留原文标题):
- Scope
- Reference Files
- Hardware
- Basic Pattern
- CUDA Availability Model
- Device selection idiom still works
- Eager loading is the right default
- Local Development: Just Install spaces
- Anti-pattern
- Do this instead
使用边界
先核对运行环境、账号、区域、依赖和最小权限。创建资源、改配置、发布服务或产生费用前必须让使用者确认。
作者、翻译与许可证
- 原作者
- Hugging Face 与 huggingface/skills contributors
- 中文翻译
- CEOFans翻译
- 许可证
- Apache-2.0
- 上游来源
- https://github.com/huggingface/skills/tree/cead19e10754e773bad24fecef83cb64be24094e/skills/huggingface-zerogpu
适用范围
平台:linux、macos、windows;标签:开发运维、ZeroGPU 应用优化
安全提示
基础静态扫描不等于绝对安全。技能可能调用命令、浏览器、云服务或本地文件,请在最小权限环境中使用,高风险操作必须人工确认。
如发现侵权、许可证或安全问题,可在本页前台提交投诉,管理员复核后可立即下架。