Commit ·
59654fb
1
Parent(s): 6891a80
Use public set_space_volumes API from huggingface_hub v1.9.0
Browse filesReplace private _jobs_api.Volume import and try/except fallback with
the now-shipped public Volume class. Bump minimum to >=1.9.0.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- atlas-deploy.py +10 -22
- atlas-e2e.py +1 -1
atlas-deploy.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
# /// script
|
| 2 |
# requires-python = ">=3.10"
|
| 3 |
# dependencies = [
|
| 4 |
-
# "huggingface-hub>=1.
|
| 5 |
# ]
|
| 6 |
# ///
|
| 7 |
|
|
@@ -30,7 +30,7 @@ import argparse
|
|
| 30 |
import json
|
| 31 |
import os
|
| 32 |
|
| 33 |
-
from huggingface_hub import HfApi, create_repo, upload_file
|
| 34 |
|
| 35 |
|
| 36 |
DOCKERFILE_TEMPLATE = """FROM python:3.12-slim
|
|
@@ -174,30 +174,18 @@ def main():
|
|
| 174 |
api.request_space_hardware(args.space_id, args.hardware)
|
| 175 |
print(f"Hardware: {args.hardware}")
|
| 176 |
|
| 177 |
-
#
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
],
|
| 186 |
-
)
|
| 187 |
-
mounted = True
|
| 188 |
-
print(f"Bucket mounted: {args.bucket} -> /data (read-only)")
|
| 189 |
-
except (ImportError, AttributeError):
|
| 190 |
-
pass
|
| 191 |
|
| 192 |
space_url = f"https://huggingface.co/spaces/{args.space_id}"
|
| 193 |
print(f"\nSpace deployed: {space_url}")
|
| 194 |
|
| 195 |
-
if not mounted:
|
| 196 |
-
print("\n⚠️ Mount the bucket manually in Space settings:")
|
| 197 |
-
print(f" Bucket: {args.bucket}")
|
| 198 |
-
print(" Mount path: /data")
|
| 199 |
-
print(" Access mode: Read-only")
|
| 200 |
-
|
| 201 |
|
| 202 |
if __name__ == "__main__":
|
| 203 |
main()
|
|
|
|
| 1 |
# /// script
|
| 2 |
# requires-python = ">=3.10"
|
| 3 |
# dependencies = [
|
| 4 |
+
# "huggingface-hub>=1.9.0",
|
| 5 |
# ]
|
| 6 |
# ///
|
| 7 |
|
|
|
|
| 30 |
import json
|
| 31 |
import os
|
| 32 |
|
| 33 |
+
from huggingface_hub import HfApi, Volume, create_repo, upload_file
|
| 34 |
|
| 35 |
|
| 36 |
DOCKERFILE_TEMPLATE = """FROM python:3.12-slim
|
|
|
|
| 174 |
api.request_space_hardware(args.space_id, args.hardware)
|
| 175 |
print(f"Hardware: {args.hardware}")
|
| 176 |
|
| 177 |
+
# Mount bucket volume
|
| 178 |
+
api.set_space_volumes(
|
| 179 |
+
args.space_id,
|
| 180 |
+
volumes=[
|
| 181 |
+
Volume(type="bucket", source=args.bucket, mount_path="/data", read_only=True),
|
| 182 |
+
],
|
| 183 |
+
)
|
| 184 |
+
print(f"Bucket mounted: {args.bucket} -> /data (read-only)")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 185 |
|
| 186 |
space_url = f"https://huggingface.co/spaces/{args.space_id}"
|
| 187 |
print(f"\nSpace deployed: {space_url}")
|
| 188 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 189 |
|
| 190 |
if __name__ == "__main__":
|
| 191 |
main()
|
atlas-e2e.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
# /// script
|
| 2 |
# requires-python = ">=3.10"
|
| 3 |
# dependencies = [
|
| 4 |
-
# "huggingface-hub>=1.
|
| 5 |
# ]
|
| 6 |
# ///
|
| 7 |
|
|
|
|
| 1 |
# /// script
|
| 2 |
# requires-python = ">=3.10"
|
| 3 |
# dependencies = [
|
| 4 |
+
# "huggingface-hub>=1.9.0",
|
| 5 |
# ]
|
| 6 |
# ///
|
| 7 |
|