File size: 863 Bytes
6539c24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env python3
'''
Upload script for djmgnn-pfas-finetuned
'''

from huggingface_hub import HfApi, create_repo

def upload_model():
    # Initialize API
    api = HfApi()
    
    # Create repository (if it doesn't exist)
    repo_id = "saketh11/MoML-CA"
    
    try:
        create_repo(repo_id, exist_ok=True)
        print(f"Repository {repo_id} created/verified")
    except Exception as e:
        print(f"Error creating repository: {e}")
        return
    
    # Upload files to finetuned_model subdirectory
    api.upload_folder(
        folder_path="hf_models/djmgnn_pfas_finetuned",
        repo_id=repo_id,
        path_in_repo="finetuned_model",
        commit_message="Upload djmgnn-pfas-finetuned model"
    )
    
    print(f"Model uploaded successfully to https://huggingface.co/{repo_id}")

if __name__ == "__main__":
    upload_model()