jaytonde05's picture
Add model quantization scripts and command reference
e695de7 verified
Raw
History Blame Contribute Delete
814 Bytes
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")