File size: 2,513 Bytes
7d3d63c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/env python3
"""
FINAL UPLOAD SCRIPT - Run this after authentication
Repository: megharudushi/Sheikh
"""

import os
from huggingface_hub import HfApi, create_repo, upload_folder

def final_upload():
    """Upload the complete Bengali AI model"""
    
    print("πŸ‡§πŸ‡© FINAL BANGLI AI UPLOAD")
    print("=" * 35)
    
    # Initialize API
    api = HfApi()
    
    try:
        # Check authentication
        user = api.whoami()
        print(f"βœ… Authenticated as: {user['name']}")
        
        # Repository details
        repo_id = "megharudushi/Sheikh"
        local_dir = "./ready_bengali_ai"
        
        # Verify files
        files = os.listdir(local_dir)
        print(f"πŸ“ Found {len(files)} files to upload:")
        for file in sorted(files):
            size = os.path.getsize(f"{local_dir}/{file}") / (1024*1024)
            print(f"  πŸ“„ {file} ({size:.1f}MB)")
        
        # Create repository
        print(f"\nπŸ”— Creating/Accessing repository: {repo_id}")
        repo_url = create_repo(
            repo_id=repo_id,
            exist_ok=True,
            repo_type="model"
        )
        print(f"βœ… Repository ready!")
        
        # Upload everything
        print(f"\nπŸ“€ Uploading model to Hugging Face...")
        upload_folder(
            folder_path=local_dir,
            repo_id=repo_id,
            commit_message="Complete Bengali AI model - 355M parameters with full tokenizer"
        )
        
        print("\nπŸŽ‰ SUCCESS! Model uploaded!")
        print(f"🌐 View at: https://huggingface.co/{repo_id}")
        print(f"πŸ“¦ Model ready for use by anyone!")
        
        return True
        
    except Exception as e:
        print(f"❌ Upload failed: {e}")
        return False

if __name__ == "__main__":
    # Run upload
    success = final_upload()
    
    if success:
        print("\n" + "="*50)
        print("🎊 CONGRATULATIONS!")
        print("Your Bengali AI model is now live on Hugging Face!")
        print("Repository: https://huggingface.co/megharudushi/Sheikh")
        print("Anyone can now use your model with:")
        print("```python")
        print("from transformers import AutoTokenizer, AutoModelForCausalLM")
        print('tokenizer = AutoTokenizer.from_pretrained("megharudushi/Sheikh")')
        print('model = AutoModelForCausalLM.from_pretrained("megharudushi/Sheikh")')
        print("```")
        print("="*50)
    else:
        print("\nπŸ”§ Please check authentication and try again.")