File size: 930 Bytes
eded815
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
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}")