Pendrokar commited on
Commit
ea64d8e
β€’
1 Parent(s): e1a50fc

xvaserver cwd to itself

Browse files
Files changed (1) hide show
  1. app.py +5 -8
app.py CHANGED
@@ -11,7 +11,7 @@ def run_xvaserver():
11
  # try:
12
  # start the process without waiting for a response
13
  print('Running xVAServer subprocess...\n')
14
- xvaserver = Popen(['python', 'resources/app/server.py'], stdout=PIPE, stderr=PIPE, universal_newlines=True)
15
  # except:
16
  # print('Could not run xVASynth.')
17
  # sys.exit(0)
@@ -19,12 +19,6 @@ def run_xvaserver():
19
  # Wait for a moment to ensure the server starts up
20
  time.sleep(10)
21
 
22
- # load default voice model
23
- load_model()
24
-
25
- # predicted = predict('test', 1.0)
26
- # print(predicted)
27
-
28
  # Check if the server is running
29
  if xvaserver.poll() is not None:
30
  print("Web server failed to start.")
@@ -41,6 +35,9 @@ def run_xvaserver():
41
 
42
  print('xVAServer running on port 8008')
43
 
 
 
 
44
  # Read and print stdout and stderr of the subprocess
45
  while True:
46
  output = xvaserver.stdout.readline()
@@ -119,7 +116,7 @@ def predict(input, pacing):
119
  print('Failed to synthesize!')
120
 
121
  print('server.log contents:')
122
- with open('server.log', 'r') as f:
123
  print(f.read())
124
 
125
  return 22100, os.open(save_path, "rb")
 
11
  # try:
12
  # start the process without waiting for a response
13
  print('Running xVAServer subprocess...\n')
14
+ xvaserver = Popen(['python', 'resources/app/server.py'], stdout=PIPE, stderr=PIPE, cwd=f'{os.path.dirname(os.path.abspath(__file__))}/resources/app/')
15
  # except:
16
  # print('Could not run xVASynth.')
17
  # sys.exit(0)
 
19
  # Wait for a moment to ensure the server starts up
20
  time.sleep(10)
21
 
 
 
 
 
 
 
22
  # Check if the server is running
23
  if xvaserver.poll() is not None:
24
  print("Web server failed to start.")
 
35
 
36
  print('xVAServer running on port 8008')
37
 
38
+ # load default voice model
39
+ load_model()
40
+
41
  # Read and print stdout and stderr of the subprocess
42
  while True:
43
  output = xvaserver.stdout.readline()
 
116
  print('Failed to synthesize!')
117
 
118
  print('server.log contents:')
119
+ with open('resources/app/server.log', 'r') as f:
120
  print(f.read())
121
 
122
  return 22100, os.open(save_path, "rb")