Pendrokar commited on
Commit
f67cac3
β€’
1 Parent(s): 5c4653b

verbose xva startup

Browse files
Files changed (1) hide show
  1. app.py +12 -4
app.py CHANGED
@@ -8,16 +8,24 @@ import gradio as gr
8
 
9
  def run_xvaserver():
10
  try:
11
- import logging
12
  # start the process without waiting for a response
13
- logging.info('loginfo: Running xVAServer subprocess...')
14
  print('Running xVAServer subprocess...')
15
  xvaserver = Popen(['python', 'server.py'], stdout=PIPE, stderr=PIPE, universal_newlines=True)
16
  except:
17
- import logging
18
- logging.error(f'Could not run xVASynth.')
19
  sys.exit(0)
20
 
 
 
 
 
 
 
 
 
 
 
 
21
  # Read and print stdout and stderr of the subprocess
22
  while True:
23
  output = xvaserver.stdout.readline()
 
8
 
9
  def run_xvaserver():
10
  try:
 
11
  # start the process without waiting for a response
 
12
  print('Running xVAServer subprocess...')
13
  xvaserver = Popen(['python', 'server.py'], stdout=PIPE, stderr=PIPE, universal_newlines=True)
14
  except:
15
+ print('Could not run xVASynth.')
 
16
  sys.exit(0)
17
 
18
+ # Wait for a moment to ensure the server starts up
19
+ time.sleep(10)
20
+
21
+ # Check if the server is running
22
+ if xvaserver.poll() is not None:
23
+ print("Web server failed to start.")
24
+ sys.exit(0)
25
+
26
+ requests.get('http://0.0.0.0:8008')
27
+ print('xVAServer running on port 8008')
28
+
29
  # Read and print stdout and stderr of the subprocess
30
  while True:
31
  output = xvaserver.stdout.readline()