Spaces:
Sleeping
Sleeping
| """ | |
| Quick test to verify gradio_demo.py can be imported and has valid structure | |
| """ | |
| import sys | |
| print("Testing gradio_demo.py import...") | |
| try: | |
| import gradio_demo | |
| print("β gradio_demo.py imported successfully") | |
| # Check if demo exists | |
| if hasattr(gradio_demo, 'demo'): | |
| print("β 'demo' object found") | |
| demo = gradio_demo.demo | |
| # Try to get API info | |
| try: | |
| api_info = demo.get_api_info() | |
| print(f"β API info retrieved: {len(api_info)} endpoints found") | |
| for endpoint_name, endpoint_info in api_info.items(): | |
| print(f" - {endpoint_name}") | |
| except Exception as e: | |
| print(f"β Failed to get API info: {e}") | |
| import traceback | |
| traceback.print_exc() | |
| else: | |
| print("β 'demo' object not found in module") | |
| except Exception as e: | |
| print(f"β Failed to import: {e}") | |
| import traceback | |
| traceback.print_exc() | |
| sys.exit(1) | |
| print("\nβ All tests passed!") | |