Create upload_model.py
Browse files- upload_model.py +26 -0
upload_model.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from huggingface_hub import HfApi, login
|
| 2 |
+
import os
|
| 3 |
+
|
| 4 |
+
# Step 1: Login with your token
|
| 5 |
+
print("Logging in to HuggingFace...")
|
| 6 |
+
login(token="hf_xxxxxxxxxxxxx") # Paste your token here
|
| 7 |
+
# Or just run: login() # Will prompt for token
|
| 8 |
+
|
| 9 |
+
print("✅ Logged in!")
|
| 10 |
+
|
| 11 |
+
# Step 2: Upload your model
|
| 12 |
+
print("\n📤 Uploading model (this may take 10-30 minutes for 4.8GB)...")
|
| 13 |
+
|
| 14 |
+
api = HfApi()
|
| 15 |
+
|
| 16 |
+
model_path = r"D:\Works\Dropbox\_Projects\HuggingFace Projects\Trained Models\Qwen3-4B-Inst_info_extractor_final\info_extractor_merged"
|
| 17 |
+
|
| 18 |
+
api.upload_folder(
|
| 19 |
+
folder_path=model_path,
|
| 20 |
+
repo_id="jejunepixels/qwen3-info-extractor", # Change to your username!
|
| 21 |
+
repo_type="model",
|
| 22 |
+
commit_message="Upload trained Qwen3 info extractor model"
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
print("\n✅ Upload complete!")
|
| 26 |
+
print("🔗 View at: https://huggingface.co/jejunepixels/qwen3-info-extractor")
|