mrfakename commited on
Commit
44c6ab3
1 Parent(s): 7c9ab75

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -61,7 +61,9 @@ def serve_wav():
61
  text = request.json['text']
62
  else:
63
  text = request.form['text'].strip()
64
-
 
 
65
  texts = split_and_recombine_text(text)
66
  audios = []
67
  noise = torch.randn(1,1,256).to('cuda' if torch.cuda.is_available() else 'cpu')
 
61
  text = request.json['text']
62
  else:
63
  text = request.form['text'].strip()
64
+ if not: text.strip()
65
+ error_response = {'error': 'Empty text. Please ensure "text" in not empty.'}
66
+ return jsonify(error_response), 400
67
  texts = split_and_recombine_text(text)
68
  audios = []
69
  noise = torch.randn(1,1,256).to('cuda' if torch.cuda.is_available() else 'cpu')