""" Script to push InklyAI to Hugging Face Hub """ import os from huggingface_hub import HfApi, create_repo, upload_folder from pathlib import Path def push_to_huggingface(): """Push the InklyAI repository to Hugging Face Hub.""" # Initialize Hugging Face API api = HfApi() # Repository details repo_id = "pravinai/InklyAI" repo_type = "model" print("šŸš€ Pushing InklyAI to Hugging Face Hub...") print(f"Repository: {repo_id}") try: # Create repository if it doesn't exist print("šŸ“ Creating repository...") create_repo( repo_id=repo_id, repo_type=repo_type, exist_ok=True, private=False ) print("āœ… Repository created successfully!") # Upload the entire folder print("šŸ“¤ Uploading files...") upload_folder( folder_path=".", repo_id=repo_id, repo_type=repo_type, ignore_patterns=[ "*.pyc", "__pycache__", ".git", ".gitignore", "*.log", "logs/", "uploads/", "data/samples/", "evaluation_results/", "models/", "*.pth", "*.pt", "*.bin", "*.npy", "*.json", "tmp/", "temp/" ] ) print("āœ… Files uploaded successfully!") # Upload model card print("šŸ“‹ Uploading model card...") api.upload_file( path_or_fileobj="model_card.md", path_in_repo="README.md", repo_id=repo_id, repo_type=repo_type ) print("āœ… Model card uploaded successfully!") print(f"\nšŸŽ‰ Successfully pushed to Hugging Face!") print(f"šŸ”— Repository URL: https://huggingface.co/{repo_id}") except Exception as e: print(f"āŒ Error pushing to Hugging Face: {e}") return False return True if __name__ == "__main__": success = push_to_huggingface() if success: print("\nāœ… InklyAI is now available on Hugging Face Hub!") print("🌐 You can access it at: https://huggingface.co/pravinai/InklyAI") else: print("\nāŒ Failed to push to Hugging Face Hub")