Molbap HF Staff commited on
Commit
3f4e938
·
verified ·
1 Parent(s): e199518

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. build/torch-universal/metadata.json +1 -0
  2. publish.sh +13 -1
build/torch-universal/metadata.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"id": "kernel-image-resize", "name": "kernel-image-resize", "version": 1, "license": "Apache-2.0", "upstream": null, "python-depends": [], "backend": {"type": "cuda"}}
publish.sh CHANGED
@@ -17,7 +17,19 @@ mkdir -p "$HERE/build/torch-universal"
17
  cp -r "$HERE/torch-ext/$NAME" "$HERE/build/torch-universal/$NAME"
18
  find "$HERE/build" -name __pycache__ -type d -exec rm -rf {} + 2>/dev/null || true
19
 
20
- echo "built build/torch-universal/$NAME"
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
  # Create the kernel repo and upload. Uses the Python API because it reliably accepts
23
  # repo_type="kernel" (the hf CLI's repo-type choices can be stricter).
 
17
  cp -r "$HERE/torch-ext/$NAME" "$HERE/build/torch-universal/$NAME"
18
  find "$HERE/build" -name __pycache__ -type d -exec rm -rf {} + 2>/dev/null || true
19
 
20
+ # metadata.json at the variant root: get_kernel reads it to find the package (name.python_name) and
21
+ # its deps. A Triton universal kernel runs on CUDA, so backend=cuda; the variant is already chosen by
22
+ # the torch-universal directory name. Field names are dash-cased (python-depends), version is an int.
23
+ python - "$HERE/build/torch-universal/metadata.json" <<'PY'
24
+ import json, sys
25
+ json.dump(
26
+ {"id": "kernel-image-resize", "name": "kernel-image-resize", "version": 1, "license": "Apache-2.0",
27
+ "upstream": None, "python-depends": [], "backend": {"type": "cuda"}},
28
+ open(sys.argv[1], "w"),
29
+ )
30
+ PY
31
+
32
+ echo "built build/torch-universal/$NAME + metadata.json"
33
 
34
  # Create the kernel repo and upload. Uses the Python API because it reliably accepts
35
  # repo_type="kernel" (the hf CLI's repo-type choices can be stricter).