#!/usr/bin/env python3 """ Execute the exact commands from user: hf auth login hf upload megharudushi/Sheikh . """ import os import subprocess def execute_user_commands(): """Execute the exact commands the user provided""" print("šŸš€ Executing Your Hugging Face Upload Commands") print("=" * 50) print("Commands to run:") print("1. hf auth login") print("2. hf upload megharudushi/Sheikh .") print("=" * 50) # Check model files 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"šŸ“ Ready to upload: {len(files)} files") # Show the exact command to run print("\nšŸŽÆ EXACT COMMANDS TO RUN:") print("=" * 30) print("hf auth login") print("hf upload megharudushi/Sheikh .") print("=" * 30) # Check for token environment variable token = os.environ.get('HF_TOKEN') if token: print(f"\nāœ… Token found: {token[:8]}...") print("šŸš€ Running upload...") try: # Run upload with token env = os.environ.copy() result = subprocess.run( ["hf", "upload", "megharudushi/Sheikh", "."], env=env, capture_output=True, text=True ) if result.returncode == 0: print("\nšŸŽ‰ SUCCESS! Model uploaded!") print("🌐 https://huggingface.co/megharudushi/Sheikh") return True else: print(f"āŒ Upload failed: {result.stderr}") return False except Exception as e: print(f"āŒ Error: {e}") return False else: print("\nāŒ No HF_TOKEN environment variable found") print("\nšŸ”§ TO COMPLETE UPLOAD:") print("1. Get your token: https://huggingface.co/settings/tokens") print("2. Set environment variable:") print(" export HF_TOKEN=your_token_here") print("3. Run the commands:") print(" hf auth login") print(" hf upload megharudushi/Sheikh .") return False if __name__ == "__main__": print("šŸ‡§šŸ‡© EXECUTING YOUR HUGGING FACE COMMANDS") print("Repository: megharudushi/Sheikh") success = execute_user_commands() if success: print("\nšŸŽŠ YOUR BANGLI AI IS NOW LIVE!") print("Anyone can use it with:") print("from transformers import AutoTokenizer, AutoModelForCausalLM") print('tokenizer = AutoTokenizer.from_pretrained("megharudushi/Sheikh")') print('model = AutoModelForCausalLM.from_pretrained("megharudushi/Sheikh")') else: print("\nšŸ“‹ SETUP REQUIRED:") print("Get your HF token and run the commands above.")