|
|
|
|
|
""" |
|
|
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) |
|
|
|
|
|
|
|
|
if not os.path.exists("ready_bengali_ai"): |
|
|
print("❌ Error: ready_bengali_ai directory not found!") |
|
|
return False |
|
|
|
|
|
|
|
|
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: |
|
|
|
|
|
print("🔑 Please login with your Hugging Face credentials...") |
|
|
login() |
|
|
print("✅ Login successful!") |
|
|
|
|
|
|
|
|
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.") |