Pendrokar commited on
Commit
49e4ff0
โ€ข
1 Parent(s): 0191adb

60 second xvaserver Web request timeouts

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -39,7 +39,6 @@ languages = [
39
  ("๐Ÿ‡ต๐Ÿ‡ฑ PL", "pl"),
40
  ("๐Ÿ‡ท๐Ÿ‡ด RO", "ro"),
41
  ("๐Ÿ‡ธ๐Ÿ‡ช SV", "sv"),
42
- ("SW", "sw"),
43
  ("๐Ÿ‡ฉ๐Ÿ‡ฐ DA", "da"),
44
  ("๐Ÿ‡ซ๐Ÿ‡ฎ FI", "fi"),
45
  ("๐Ÿ‡ญ๐Ÿ‡บ HU", "hu"),
@@ -56,6 +55,7 @@ languages = [
56
  ("๐Ÿ‡ป๐Ÿ‡ณ VI", "vi"),
57
  ("๐Ÿ‡ป๐Ÿ‡ฆ LA", "la"),
58
  ("HA", "ha"),
 
59
  ("๐Ÿ‡ณ๐Ÿ‡ฌ YO", "yo"),
60
  ("WO", "wo"),
61
  ]
@@ -138,7 +138,7 @@ def load_model(voice_model_name):
138
  }
139
 
140
  try:
141
- response = requests.post('http://0.0.0.0:8008/loadModel', json=data)
142
  response.raise_for_status() # If the response contains an HTTP error status code, raise an exception
143
  current_voice_model = voice_model_name
144
  except requests.exceptions.RequestException as err:
@@ -196,7 +196,7 @@ def predict(
196
  }
197
 
198
  try:
199
- response = requests.post('http://0.0.0.0:8008/synthesize', json=data)
200
  response.raise_for_status() # If the response contains an HTTP error status code, raise an exception
201
  except requests.exceptions.RequestException as err:
202
  print('Failed to synthesize!')
 
39
  ("๐Ÿ‡ต๐Ÿ‡ฑ PL", "pl"),
40
  ("๐Ÿ‡ท๐Ÿ‡ด RO", "ro"),
41
  ("๐Ÿ‡ธ๐Ÿ‡ช SV", "sv"),
 
42
  ("๐Ÿ‡ฉ๐Ÿ‡ฐ DA", "da"),
43
  ("๐Ÿ‡ซ๐Ÿ‡ฎ FI", "fi"),
44
  ("๐Ÿ‡ญ๐Ÿ‡บ HU", "hu"),
 
55
  ("๐Ÿ‡ป๐Ÿ‡ณ VI", "vi"),
56
  ("๐Ÿ‡ป๐Ÿ‡ฆ LA", "la"),
57
  ("HA", "ha"),
58
+ ("SW", "sw"),
59
  ("๐Ÿ‡ณ๐Ÿ‡ฌ YO", "yo"),
60
  ("WO", "wo"),
61
  ]
 
138
  }
139
 
140
  try:
141
+ response = requests.post('http://0.0.0.0:8008/loadModel', json=data, timeout=60)
142
  response.raise_for_status() # If the response contains an HTTP error status code, raise an exception
143
  current_voice_model = voice_model_name
144
  except requests.exceptions.RequestException as err:
 
196
  }
197
 
198
  try:
199
+ response = requests.post('http://0.0.0.0:8008/synthesize', json=data, timeout=60)
200
  response.raise_for_status() # If the response contains an HTTP error status code, raise an exception
201
  except requests.exceptions.RequestException as err:
202
  print('Failed to synthesize!')