AIencoder commited on
Commit
dbf3196
·
verified ·
1 Parent(s): 80f0d9f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -19
app.py CHANGED
@@ -1,12 +1,14 @@
1
- import gradio as gr
2
- from src.chimera_core import Chimera
3
- import asyncio
4
- import sys
5
  import warnings
 
6
 
7
- # Suppress the specific asyncio warning for Python 3.13
8
- if sys.version_info >= (3, 13):
9
- warnings.filterwarnings('ignore', category=RuntimeWarning, module='asyncio')
 
 
 
 
 
10
 
11
  # Initialize
12
  try:
@@ -109,15 +111,4 @@ with gr.Blocks(title="Axon God Mode") as demo:
109
  )
110
 
111
  if __name__ == "__main__":
112
- try:
113
- demo.launch(ssr_mode=False, css=custom_css)
114
- finally:
115
- # Clean up event loop on exit
116
- try:
117
- loop = asyncio.get_event_loop()
118
- if loop.is_running():
119
- loop.stop()
120
- if not loop.is_closed():
121
- loop.close()
122
- except Exception:
123
- pass
 
 
 
 
 
1
  import warnings
2
+ import sys
3
 
4
+ # Suppress asyncio warnings (Python 3.12/3.13 known issue with Gradio)
5
+ warnings.filterwarnings('ignore', message='.*Invalid file descriptor.*')
6
+ if sys.version_info >= (3, 12):
7
+ import logging
8
+ logging.getLogger('asyncio').setLevel(logging.CRITICAL)
9
+
10
+ import gradio as gr
11
+ from src.chimera_core import Chimera
12
 
13
  # Initialize
14
  try:
 
111
  )
112
 
113
  if __name__ == "__main__":
114
+ demo.launch(ssr_mode=False, css=custom_css)