| |
| """ |
| 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) |
| |
| |
| api = HfApi() |
| |
| try: |
| |
| user = api.whoami() |
| print(f"✅ Authenticated as: {user['name']}") |
| |
| |
| repo_id = "megharudushi/Sheikh" |
| local_dir = "./ready_bengali_ai" |
| |
| |
| 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)") |
| |
| |
| 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!") |
| |
| |
| 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__": |
| |
| 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.") |