Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
do not rerun xVASynth if active
Browse files
app.py
CHANGED
|
@@ -216,7 +216,7 @@ def predict(
|
|
| 216 |
except requests.exceptions.RequestException as err:
|
| 217 |
print('Failed to synthesize!')
|
| 218 |
save_path = ''
|
| 219 |
-
json_data = {text: 'Failed'}
|
| 220 |
|
| 221 |
print('server.log contents:')
|
| 222 |
with open('resources/app/server.log', 'r') as f:
|
|
@@ -460,9 +460,16 @@ with gr.Blocks(css=".arpabet {display: inline-block; background-color: gray; bor
|
|
| 460 |
|
| 461 |
if __name__ == "__main__":
|
| 462 |
# Run the web server in a separate thread
|
| 463 |
-
|
| 464 |
-
print('
|
| 465 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 466 |
|
| 467 |
print('running Gradio interface')
|
| 468 |
demo.launch()
|
|
|
|
| 216 |
except requests.exceptions.RequestException as err:
|
| 217 |
print('Failed to synthesize!')
|
| 218 |
save_path = ''
|
| 219 |
+
json_data = {'text': 'Failed'}
|
| 220 |
|
| 221 |
print('server.log contents:')
|
| 222 |
with open('resources/app/server.log', 'r') as f:
|
|
|
|
| 460 |
|
| 461 |
if __name__ == "__main__":
|
| 462 |
# Run the web server in a separate thread
|
| 463 |
+
|
| 464 |
+
print('Attempting to connect to local xVASynth server...')
|
| 465 |
+
try:
|
| 466 |
+
response = requests.get('http://0.0.0.0:8008')
|
| 467 |
+
response.raise_for_status() # If the response contains an HTTP error status code, raise an exception
|
| 468 |
+
except requests.exceptions.RequestException as err:
|
| 469 |
+
print('Failed to connect to xVASynth!')
|
| 470 |
+
web_server_thread = threading.Thread(target=run_xvaserver)
|
| 471 |
+
print('Starting xVAServer thread')
|
| 472 |
+
web_server_thread.start()
|
| 473 |
|
| 474 |
print('running Gradio interface')
|
| 475 |
demo.launch()
|