Spaces:
Sleeping
Sleeping
| #!/usr/bin/env python3 | |
| """ | |
| Script to replace the problematic app.py with working version | |
| """ | |
| import shutil | |
| import os | |
| def replace_app(): | |
| """Replace app.py with working version""" | |
| try: | |
| # Backup original | |
| if os.path.exists("app.py"): | |
| shutil.copy("app.py", "app_backup.py") | |
| print("✅ Original app.py backed up as app_backup.py") | |
| # Copy working version | |
| shutil.copy("app_working.py", "app.py") | |
| print("✅ app.py replaced with working version") | |
| print("\n=== HF Space Ready ===") | |
| print("The Hugging Face Space should now work without schema errors.") | |
| print("You can manually copy app_working.py to app.py in your HF Space repository.") | |
| except Exception as e: | |
| print(f"❌ Error replacing app.py: {e}") | |
| if __name__ == "__main__": | |
| replace_app() |