Spaces:
Sleeping
Sleeping
Commit ·
f5992a2
1
Parent(s): 8dc20ae
fix: support ZeroGPU Python 3.10 runtime
Browse files- README.md +2 -2
- openpi_runtime/openpi/shared/download.py +1 -1
- tests/test_space_config.py +7 -1
README.md
CHANGED
|
@@ -5,7 +5,7 @@ colorFrom: red
|
|
| 5 |
colorTo: yellow
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 5.49.1
|
| 8 |
-
python_version: '3.
|
| 9 |
app_file: app.py
|
| 10 |
pinned: false
|
| 11 |
---
|
|
@@ -63,7 +63,7 @@ For local use with all dependencies installed:
|
|
| 63 |
PYTHONPATH=openpi_runtime python app.py
|
| 64 |
```
|
| 65 |
|
| 66 |
-
The
|
| 67 |
|
| 68 |
## Optional real-checkpoint smoke test
|
| 69 |
|
|
|
|
| 5 |
colorTo: yellow
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 5.49.1
|
| 8 |
+
python_version: '3.10'
|
| 9 |
app_file: app.py
|
| 10 |
pinned: false
|
| 11 |
---
|
|
|
|
| 63 |
PYTHONPATH=openpi_runtime python app.py
|
| 64 |
```
|
| 65 |
|
| 66 |
+
The Space runs on Python 3.10 and requires a compatible CUDA 12 GPU.
|
| 67 |
|
| 68 |
## Optional real-checkpoint smoke test
|
| 69 |
|
openpi_runtime/openpi/shared/download.py
CHANGED
|
@@ -188,7 +188,7 @@ def _ensure_permissions(path: pathlib.Path) -> None:
|
|
| 188 |
|
| 189 |
def _get_mtime(year: int, month: int, day: int) -> float:
|
| 190 |
"""Get the mtime of a given date at midnight UTC."""
|
| 191 |
-
date = datetime.datetime(year, month, day, tzinfo=datetime.
|
| 192 |
return time.mktime(date.timetuple())
|
| 193 |
|
| 194 |
|
|
|
|
| 188 |
|
| 189 |
def _get_mtime(year: int, month: int, day: int) -> float:
|
| 190 |
"""Get the mtime of a given date at midnight UTC."""
|
| 191 |
+
date = datetime.datetime(year, month, day, tzinfo=datetime.timezone.utc)
|
| 192 |
return time.mktime(date.timetuple())
|
| 193 |
|
| 194 |
|
tests/test_space_config.py
CHANGED
|
@@ -8,7 +8,7 @@ def test_space_metadata_and_runtime_files():
|
|
| 8 |
readme = (ROOT / "README.md").read_text()
|
| 9 |
requirements = (ROOT / "requirements.txt").read_text()
|
| 10 |
assert "sdk_version: 5.49.1" in readme
|
| 11 |
-
assert "python_version: '3.
|
| 12 |
assert "app_file: app.py" in readme
|
| 13 |
assert "gradio==5.49.1" in requirements
|
| 14 |
assert "huggingface-hub==0.36.2" in requirements
|
|
@@ -24,3 +24,9 @@ def test_vendored_config_contains_state_conditioned_ur_policy():
|
|
| 24 |
source = (ROOT / "openpi_runtime/openpi/training/config.py").read_text()
|
| 25 |
assert 'name="pi05_ur_demo_state"' in source
|
| 26 |
assert "LeRobotURDataConfig" in source
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
readme = (ROOT / "README.md").read_text()
|
| 9 |
requirements = (ROOT / "requirements.txt").read_text()
|
| 10 |
assert "sdk_version: 5.49.1" in readme
|
| 11 |
+
assert "python_version: '3.10'" in readme
|
| 12 |
assert "app_file: app.py" in readme
|
| 13 |
assert "gradio==5.49.1" in requirements
|
| 14 |
assert "huggingface-hub==0.36.2" in requirements
|
|
|
|
| 24 |
source = (ROOT / "openpi_runtime/openpi/training/config.py").read_text()
|
| 25 |
assert 'name="pi05_ur_demo_state"' in source
|
| 26 |
assert "LeRobotURDataConfig" in source
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def test_vendored_download_is_python_310_compatible():
|
| 30 |
+
source = (ROOT / "openpi_runtime/openpi/shared/download.py").read_text()
|
| 31 |
+
assert "datetime.UTC" not in source
|
| 32 |
+
assert "datetime.timezone.utc" in source
|