Pendrokar commited on
Commit
a65b632
β€’
1 Parent(s): 50319fb

catch model raised except

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -75,8 +75,12 @@ def load_model():
75
  'base_lang': language,
76
  'pluginsContext': '{}',
77
  }
78
- response = requests.post('http://0.0.0.0:8008/loadModel', json=data)
79
- response.raise_for_status() # If the response contains an HTTP error status code, raise an exception
 
 
 
 
80
  return
81
 
82
  def predict(input, pacing):
 
75
  'base_lang': language,
76
  'pluginsContext': '{}',
77
  }
78
+
79
+ try:
80
+ response = requests.post('http://0.0.0.0:8008/loadModel', json=data)
81
+ response.raise_for_status() # If the response contains an HTTP error status code, raise an exception
82
+ except requests.exceptions.RequestException as err:
83
+ print('Failed to load voice model!')
84
  return
85
 
86
  def predict(input, pacing):