mirror of
https://github.com/zenlm/zen-omni.git
synced 2026-07-26 22:09:03 +00:00
Add HF upload script using new hf CLI
This commit is contained in:
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
# Push Zen-Omni to HuggingFace using new hf CLI
|
||||
|
||||
echo "🚀 Pushing Zen-Omni to HuggingFace Hub"
|
||||
|
||||
# Model paths
|
||||
ORIGINAL_MODEL="$HOME/work/zen/qwen3-omni-30b-complete"
|
||||
MLX_MODEL="$HOME/work/zen/qwen3-omni-mlx/q4"
|
||||
GGUF_MODEL="$HOME/work/zen/qwen3-omni-gguf"
|
||||
|
||||
# Step 1: Upload original model weights
|
||||
echo "📦 Uploading original Qwen3-Omni weights..."
|
||||
hf upload zenlm/zen-omni-30b $ORIGINAL_MODEL . \
|
||||
--repo-type model \
|
||||
--commit-message "Upload Zen-Omni 30B base weights"
|
||||
|
||||
# Step 2: Upload MLX 4-bit version (after conversion)
|
||||
echo "🍎 Uploading MLX 4-bit version..."
|
||||
hf upload zenlm/zen-omni-30b-mlx $MLX_MODEL . \
|
||||
--repo-type model \
|
||||
--commit-message "Upload MLX 4-bit quantized model"
|
||||
|
||||
# Step 3: Upload GGUF version (after conversion)
|
||||
echo "📚 Uploading GGUF for LM Studio..."
|
||||
hf upload zenlm/zen-omni-30b-gguf $GGUF_MODEL/*.gguf . \
|
||||
--repo-type model \
|
||||
--commit-message "Upload GGUF 4-bit for LM Studio"
|
||||
|
||||
echo "✅ Upload complete!"
|
||||
echo ""
|
||||
echo "Models available at:"
|
||||
echo " - https://huggingface.co/zenlm/zen-omni-30b (original)"
|
||||
echo " - https://huggingface.co/zenlm/zen-omni-30b-mlx (MLX 4-bit)"
|
||||
echo " - https://huggingface.co/zenlm/zen-omni-30b-gguf (GGUF)"
|
||||
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Push Zen-Omni model to HuggingFace Hub.
|
||||
Weights go to HuggingFace, code stays on GitHub.
|
||||
"""
|
||||
|
||||
from huggingface_hub import HfApi, create_repo
|
||||
from pathlib import Path
|
||||
|
||||
def push_to_hf():
|
||||
api = HfApi()
|
||||
|
||||
# Create repo on HuggingFace
|
||||
repo_id = "zenlm/zen-omni-30b"
|
||||
|
||||
try:
|
||||
create_repo(repo_id, repo_type="model", exist_ok=True)
|
||||
print(f"✅ Created/verified repo: {repo_id}")
|
||||
except Exception as e:
|
||||
print(f"Repo exists or error: {e}")
|
||||
|
||||
# Upload model files (after download completes)
|
||||
model_path = Path.home() / "work/zen/qwen3-omni-30b-complete"
|
||||
|
||||
if model_path.exists():
|
||||
print(f"Uploading from {model_path}...")
|
||||
api.upload_folder(
|
||||
folder_path=str(model_path),
|
||||
repo_id=repo_id,
|
||||
repo_type="model",
|
||||
commit_message="Upload Zen-Omni 30B model weights"
|
||||
)
|
||||
print("✅ Upload complete!")
|
||||
else:
|
||||
print("⏳ Waiting for download to complete first...")
|
||||
|
||||
if __name__ == "__main__":
|
||||
push_to_hf()
|
||||
Reference in New Issue
Block a user