Claude commited on
Commit
4efb182
·
unverified ·
1 Parent(s): 6662cc9

Fix ZeroGPU compatibility: Switch from Docker to Gradio SDK

Browse files

BREAKING CHANGE: ZeroGPU requires Gradio SDK, not Docker SDK

Changes:
- Update README.md: sdk: docker -> sdk: gradio
- Add sdk_version: 5.9.1 and app_file: app.py
- Update requirements.txt: Use flexible version constraints for Python 3.10-3.12
- Update Dockerfile: Python 3.13 -> 3.12 (with note for local dev only)
- Add .dockerignore for cleaner Docker builds
- Clarify that Dockerfile is for local development only

ZeroGPU Configuration:
- SDK: Gradio (required for ZeroGPU)
- Python: 3.10-3.12 (3.13 not yet supported on HF Spaces)
- Dockerfile: Optional, for local development only

This fixes the "ZeroGPU is only available on Gradio SDK" error.

References:
- https://huggingface.co/docs/hub/spaces-config-reference
- https://huggingface.co/docs/hub/spaces-zerogpu

Files changed (4) hide show
  1. .dockerignore +44 -0
  2. Dockerfile +11 -7
  3. README.md +16 -7
  4. requirements.txt +15 -15
.dockerignore ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Git files
2
+ .git
3
+ .gitignore
4
+ .github
5
+
6
+ # Python cache
7
+ __pycache__
8
+ *.py[cod]
9
+ *$py.class
10
+ .pytest_cache
11
+ .mypy_cache
12
+ .ruff_cache
13
+
14
+ # Virtual environments
15
+ venv
16
+ env
17
+ ENV
18
+ .venv
19
+
20
+ # IDE
21
+ .vscode
22
+ .idea
23
+ *.swp
24
+ *.swo
25
+ *~
26
+
27
+ # Generated files
28
+ *.ply
29
+ *.splat
30
+ *.mp4
31
+ *.avi
32
+ *.mov
33
+ gradio_cached_examples/
34
+ flagged/
35
+ tmp/
36
+ temp/
37
+
38
+ # Documentation
39
+ README.md
40
+ LICENSE
41
+ *.md
42
+
43
+ # CI/CD
44
+ .github/
Dockerfile CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  FROM nvidia/cuda:12.4.0-cudnn-devel-ubuntu22.04
2
 
3
  # 環境変数
@@ -6,7 +10,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
6
  GRADIO_SERVER_NAME=0.0.0.0 \
7
  GRADIO_SERVER_PORT=7860
8
 
9
- # システムパッケージの更新とPython 3.13のインストール
10
  RUN apt-get update && apt-get install -y \
11
  software-properties-common \
12
  wget \
@@ -14,15 +18,15 @@ RUN apt-get update && apt-get install -y \
14
  && add-apt-repository ppa:deadsnakes/ppa \
15
  && apt-get update \
16
  && apt-get install -y \
17
- python3.13 \
18
- python3.13-dev \
19
- python3.13-venv \
20
  python3-pip \
21
  && rm -rf /var/lib/apt/lists/*
22
 
23
- # Python 3.13をデフォルトに設定
24
- RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.13 1 \
25
- && update-alternatives --install /usr/bin/python python /usr/bin/python3.13 1
26
 
27
  # pipのアップグレード
28
  RUN python3 -m pip install --upgrade pip setuptools wheel
 
1
+ # Dockerfile for local development only
2
+ # NOTE: Hugging Face Spaces uses Gradio SDK (not Docker) for ZeroGPU support
3
+ # This Dockerfile is provided for local testing and development purposes
4
+
5
  FROM nvidia/cuda:12.4.0-cudnn-devel-ubuntu22.04
6
 
7
  # 環境変数
 
10
  GRADIO_SERVER_NAME=0.0.0.0 \
11
  GRADIO_SERVER_PORT=7860
12
 
13
+ # システムパッケージの更新とPython 3.12のインストール
14
  RUN apt-get update && apt-get install -y \
15
  software-properties-common \
16
  wget \
 
18
  && add-apt-repository ppa:deadsnakes/ppa \
19
  && apt-get update \
20
  && apt-get install -y \
21
+ python3.12 \
22
+ python3.12-dev \
23
+ python3.12-venv \
24
  python3-pip \
25
  && rm -rf /var/lib/apt/lists/*
26
 
27
+ # Python 3.12をデフォルトに設定
28
+ RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1 \
29
+ && update-alternatives --install /usr/bin/python python /usr/bin/python3.12 1
30
 
31
  # pipのアップグレード
32
  RUN python3 -m pip install --upgrade pip setuptools wheel
README.md CHANGED
@@ -3,7 +3,9 @@ title: SHARP 3D Gaussian Splats Generator
3
  emoji: 🎨
4
  colorFrom: blue
5
  colorTo: purple
6
- sdk: docker
 
 
7
  pinned: false
8
  license: mit
9
  tags:
@@ -76,14 +78,15 @@ PLYファイルをダウンロードして、Blender、CloudCompare、MeshLabな
76
  - **UI**: Gradio 5.9
77
  - **3Dレンダリング**: Three.js + PLYLoader
78
  - **GPU**: ZeroGPU (Nvidia H200)
79
- - **言語**: Python 3.13
 
80
 
81
  ### 主要ライブラリ
82
  ```
83
- torch==2.5.1
84
- gsplat==1.5.3
85
  gradio==5.9.1
86
- timm==1.0.12
87
  ```
88
 
89
  ---
@@ -114,7 +117,7 @@ timm==1.0.12
114
  ## 🌐 ローカル実行
115
 
116
  ### 前提条件
117
- - Python 3.13
118
  - CUDA 12.4+ (GPU使用の場合)
119
  - 8GB以上のVRAM推奨
120
 
@@ -124,6 +127,10 @@ timm==1.0.12
124
  git clone https://github.com/YUGOROU/ml-sharp_ZeroGPU.git
125
  cd ml-sharp_ZeroGPU
126
 
 
 
 
 
127
  # 依存関係をインストール
128
  pip install -r requirements.txt
129
 
@@ -131,7 +138,9 @@ pip install -r requirements.txt
131
  python app.py
132
  ```
133
 
134
- ### Dockerで実行
 
 
135
  ```bash
136
  # Dockerイメージをビルド
137
  docker build -t sharp-app .
 
3
  emoji: 🎨
4
  colorFrom: blue
5
  colorTo: purple
6
+ sdk: gradio
7
+ sdk_version: 5.9.1
8
+ app_file: app.py
9
  pinned: false
10
  license: mit
11
  tags:
 
78
  - **UI**: Gradio 5.9
79
  - **3Dレンダリング**: Three.js + PLYLoader
80
  - **GPU**: ZeroGPU (Nvidia H200)
81
+ - **SDK**: Gradio SDK (ZeroGPU互換)
82
+ - **言語**: Python 3.10-3.12
83
 
84
  ### 主要ライブラリ
85
  ```
86
+ torch>=2.5.0
87
+ gsplat>=1.5.0
88
  gradio==5.9.1
89
+ spaces (ZeroGPU)
90
  ```
91
 
92
  ---
 
117
  ## 🌐 ローカル実行
118
 
119
  ### 前提条件
120
+ - Python 3.10-3.12 (3.13はHugging Face Spacesで未対応)
121
  - CUDA 12.4+ (GPU使用の場合)
122
  - 8GB以上のVRAM推奨
123
 
 
127
  git clone https://github.com/YUGOROU/ml-sharp_ZeroGPU.git
128
  cd ml-sharp_ZeroGPU
129
 
130
+ # 仮想環境の作成 (推奨)
131
+ python -m venv venv
132
+ source venv/bin/activate # Windows: venv\Scripts\activate
133
+
134
  # 依存関係をインストール
135
  pip install -r requirements.txt
136
 
 
138
  python app.py
139
  ```
140
 
141
+ ### Dockerで実行 (オプション)
142
+ **注意**: Hugging Face SpacesではGradio SDKを使用するためDockerは不要ですが、ローカル開発ではDockerを使用できます。
143
+
144
  ```bash
145
  # Dockerイメージをビルド
146
  docker build -t sharp-app .
requirements.txt CHANGED
@@ -1,23 +1,23 @@
1
  # Core dependencies for SHARP
2
- torch==2.5.1
3
- torchvision==0.20.1
4
- timm==1.0.12
5
- gsplat==1.5.3
6
- scipy==1.14.1
7
- numpy==2.1.3
8
- pillow==11.0.0
9
- pillow-heif==0.20.0
10
- imageio==2.37.0
11
- imageio-ffmpeg==0.6.0
12
- click==8.1.8
13
- plyfile==1.1.2
14
- huggingface-hub==0.27.0
15
 
16
  # Gradio for UI
17
  gradio==5.9.1
18
 
19
- # Spaces GPU support
20
  spaces
21
 
22
- # SHARP package from GitHub
23
  git+https://github.com/apple/ml-sharp.git
 
1
  # Core dependencies for SHARP
2
+ torch>=2.5.0
3
+ torchvision>=0.20.0
4
+ timm>=1.0.0
5
+ gsplat>=1.5.0
6
+ scipy>=1.14.0
7
+ numpy>=2.1.0,<3.0.0
8
+ pillow>=11.0.0
9
+ pillow-heif>=0.20.0
10
+ imageio>=2.37.0
11
+ imageio-ffmpeg>=0.6.0
12
+ click>=8.1.0
13
+ plyfile>=1.1.0
14
+ huggingface-hub>=0.27.0
15
 
16
  # Gradio for UI
17
  gradio==5.9.1
18
 
19
+ # Spaces ZeroGPU support
20
  spaces
21
 
22
+ # SHARP package from GitHub (compatible with Python 3.10+)
23
  git+https://github.com/apple/ml-sharp.git