import sys from huggingface_hub import HfApi, upload_folder # Force UTF-8 stdout if sys.stdout.encoding != 'utf-8': try: sys.stdout.reconfigure(encoding='utf-8') except Exception: pass api = HfApi() repo_id = "unknownBrain/BioHCL-SSSM-Pediatric-Pneumonia" staging_dir = r"C:\Users\Acer\Documents\myproject\medical imaging\hf_repo_staging" print(f"Creating public repository '{repo_id}' on Hugging Face...") api.create_repo(repo_id=repo_id, repo_type="model", exist_ok=True, private=False) print("Repository created / verified.") print(f"Uploading files from '{staging_dir}' to '{repo_id}'...") upload_folder( folder_path=staging_dir, repo_id=repo_id, repo_type="model", commit_message="Initial release: BioHCL-SSSM pre-trained weights, modular code, benchmarks and ablations" ) print("\nAll files uploaded successfully to Hugging Face!") print(f"URL: https://huggingface.co/{repo_id}")