Spaces:
Sleeping
Sleeping
| #\!/usr/bin/env python | |
| """ | |
| Simple script to fix the gr.Group error in app.py | |
| """ | |
| import os | |
| import re | |
| # Path to the app.py file | |
| app_path = "/home/user/app/app.py" | |
| # Read the file | |
| with open(app_path, "r") as f: | |
| content = f.read() | |
| # Fix the gr.Group initialization | |
| fixed_content = re.sub( | |
| r'gr\.Group\("([^"]+)"\)', | |
| r'gr.Group(label="\1")', | |
| content | |
| ) | |
| # Write the fixed content back | |
| with open(app_path, "w") as f: | |
| f.write(fixed_content) | |
| print("Fixed the gr.Group initialization in app.py") | |
| print("You can now run: python app.py") | |