Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
import sys
|
2 |
-
import signal
|
3 |
import shutil
|
4 |
import logging
|
5 |
import time
|
@@ -460,12 +459,6 @@ def cleanup():
|
|
460 |
except Exception as e:
|
461 |
print(f"Error during cleanup: {str(e)}")
|
462 |
|
463 |
-
# Signal handler
|
464 |
-
def signal_handler(signum, frame):
|
465 |
-
logger.info(f"Received signal {signum}")
|
466 |
-
cleanup()
|
467 |
-
sys.exit(0)
|
468 |
-
|
469 |
@spaces.GPU()
|
470 |
def main():
|
471 |
# Initialize environment and logger
|
@@ -474,8 +467,6 @@ def main():
|
|
474 |
|
475 |
# Register cleanup handlers
|
476 |
atexit.register(cleanup)
|
477 |
-
signal.signal(signal.SIGINT, signal_handler)
|
478 |
-
signal.signal(signal.SIGTERM, signal_handler)
|
479 |
|
480 |
# Create Gradio interface
|
481 |
demo = create_gradio_interface()
|
|
|
1 |
import sys
|
|
|
2 |
import shutil
|
3 |
import logging
|
4 |
import time
|
|
|
459 |
except Exception as e:
|
460 |
print(f"Error during cleanup: {str(e)}")
|
461 |
|
|
|
|
|
|
|
|
|
|
|
|
|
462 |
@spaces.GPU()
|
463 |
def main():
|
464 |
# Initialize environment and logger
|
|
|
467 |
|
468 |
# Register cleanup handlers
|
469 |
atexit.register(cleanup)
|
|
|
|
|
470 |
|
471 |
# Create Gradio interface
|
472 |
demo = create_gradio_interface()
|