Sheikh / simple_hf_upload.py
megharudushi's picture
Upload folder using huggingface_hub
7d3d63c verified
#!/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.")