#!/usr/bin/env python3 """ Simple Hugging Face upload using direct login and upload_folder Repository: megharudushi/Sheikh """ from huggingface_hub import login, upload_folder import os def upload_bengali_ai(): """Upload Bengali AI model using simple approach""" print("šŸš€ Uploading Bengali AI to Hugging Face Hub...") print("=" * 50) # Check if model directory exists if not os.path.exists("ready_bengali_ai"): print("āŒ Error: ready_bengali_ai directory not found!") return False # Show files to upload files = os.listdir("ready_bengali_ai") print(f"šŸ“ Files to upload ({len(files)} total):") for file in sorted(files): size = os.path.getsize(f"ready_bengali_ai/{file}") / (1024*1024) print(f" šŸ“„ {file} ({size:.1f}MB)") print("\n" + "="*50) try: # Login with Hugging Face credentials print("šŸ”‘ Please login with your Hugging Face credentials...") login() print("āœ… Login successful!") # Upload model files print(f"\nšŸ“¤ Uploading to repository: megharudushi/Sheikh") upload_folder( folder_path="ready_bengali_ai", repo_id="megharudushi/Sheikh", repo_type="model" ) print("\nšŸŽ‰ SUCCESS! Your Bengali AI model is now on Hugging Face!") print(f"🌐 Repository: https://huggingface.co/megharudushi/Sheikh") print("\nšŸ’” Anyone can now use your model:") print("```python") print("from transformers import AutoTokenizer, AutoModelForCausalLM") print('tokenizer = AutoTokenizer.from_pretrained("megharudushi/Sheikh")') print('model = AutoModelForCausalLM.from_pretrained("megharudushi/Sheikh")') print("```") return True except Exception as e: print(f"āŒ Upload failed: {e}") return False if __name__ == "__main__": print("šŸ‡§šŸ‡© BANGLI AI - HUGGING FACE UPLOAD") print("Repository: megharudushi/Sheikh") print("=" * 45) success = upload_bengali_ai() if success: print("\nšŸŽŠ UPLOAD COMPLETE!") print("Your Bengali AI model is now live and ready to use!") else: print("\nāš ļø Upload failed. Please check the error above.")