File size: 814 Bytes
e695de7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | import os
from huggingface_hub import HfApi
LOCAL_DIR = "/home/Qwen3-8B-MXFP8-AWQ-wikitext2"
REPO_NAME = "Qwen3-8B-MXFP8-AWQ-wikitext2"
token = os.environ.get("HF_TOKEN")
if not token:
raise SystemExit(
"No HF token found. Set it with: export HF_TOKEN=<your_token> "
"(note the spelling: HF_TOKEN, not HF_TOKN)."
)
api = HfApi(token=token)
user = api.whoami()["name"]
repo_id = f"{user}/{REPO_NAME}"
print(f"Creating/checking repo: {repo_id}")
api.create_repo(
repo_id=repo_id,
repo_type="model",
exist_ok=True,
)
print(f"Uploading {LOCAL_DIR} to https://huggingface.co/{repo_id}")
api.upload_folder(
folder_path=LOCAL_DIR,
repo_id=repo_id,
repo_type="model",
commit_message="Upload Qwen3-8B MXFP8 AWQ compressed checkpoint",
)
print("Upload complete") |