Skip to content
Python

added missing file

DeepBeepMeep95344b73a0e2
diff --git a/shared/utils/hf.py b/shared/utils/hf.py
new file mode 100644
index 0000000..30607e0
--- /dev/null
+++ b/shared/utils/hf.py
@@ -0,0 +1,10 @@
+import posixpath
+
+
+def build_hf_url(repo_id, *path_parts):
+ repo = (repo_id or "").strip("/")
+ parts = [part.strip("/\\") for part in path_parts if part]
+ path = posixpath.join(*parts) if parts else ""
+ if not path:
+ return f"https://huggingface.co/{repo}/resolve/main"
+ return f"https://huggingface.co/{repo}/resolve/main/{path}"