Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1988,26 +1988,35 @@ class GradioInterface:
|
|
| 1988 |
except Exception as e:
|
| 1989 |
logger.error(f"Error during cleanup: {e}")
|
| 1990 |
|
| 1991 |
-
|
|
|
|
|
|
|
| 1992 |
"""Main entry point"""
|
| 1993 |
try:
|
| 1994 |
-
#
|
| 1995 |
logging.basicConfig(
|
| 1996 |
level=logging.INFO,
|
| 1997 |
-
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1998 |
)
|
|
|
|
| 1999 |
|
| 2000 |
-
#
|
|
|
|
|
|
|
|
|
|
| 2001 |
interface = GradioInterface()
|
| 2002 |
interface.launch(
|
| 2003 |
-
|
| 2004 |
-
|
| 2005 |
-
|
| 2006 |
)
|
| 2007 |
|
| 2008 |
except Exception as e:
|
| 2009 |
logger.error(f"Application error: {e}")
|
| 2010 |
raise
|
| 2011 |
-
|
| 2012 |
-
|
| 2013 |
-
main()
|
|
|
|
| 1988 |
except Exception as e:
|
| 1989 |
logger.error(f"Error during cleanup: {e}")
|
| 1990 |
|
| 1991 |
+
# app.py - Main Entry Point
|
| 1992 |
+
|
| 1993 |
+
if __name__ == "__main__":
|
| 1994 |
"""Main entry point"""
|
| 1995 |
try:
|
| 1996 |
+
# Configure logging
|
| 1997 |
logging.basicConfig(
|
| 1998 |
level=logging.INFO,
|
| 1999 |
+
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
| 2000 |
+
handlers=[
|
| 2001 |
+
logging.StreamHandler(),
|
| 2002 |
+
logging.FileHandler('gradio_builder.log')
|
| 2003 |
+
]
|
| 2004 |
)
|
| 2005 |
+
logger = logging.getLogger(__name__)
|
| 2006 |
|
| 2007 |
+
# Log application startup
|
| 2008 |
+
logger.info("=== Application Startup ===")
|
| 2009 |
+
|
| 2010 |
+
# Initialize and launch interface
|
| 2011 |
interface = GradioInterface()
|
| 2012 |
interface.launch(
|
| 2013 |
+
server_port=DEFAULT_PORT,
|
| 2014 |
+
share=False,
|
| 2015 |
+
debug=True
|
| 2016 |
)
|
| 2017 |
|
| 2018 |
except Exception as e:
|
| 2019 |
logger.error(f"Application error: {e}")
|
| 2020 |
raise
|
| 2021 |
+
finally:
|
| 2022 |
+
logger.info("=== Application Shutdown ===")
|
|
|