adefossez commited on
Commit
2e0c668
1 Parent(s): 8764625

adding checks

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -119,6 +119,13 @@ def predict_batched(texts, melodies):
119
  def predict_full(model, text, melody, duration, topk, topp, temperature, cfg_coef, progress=gr.Progress()):
120
  global INTERRUPTING
121
  INTERRUPTING = False
 
 
 
 
 
 
 
122
  topk = int(topk)
123
  load_model(model)
124
 
 
119
  def predict_full(model, text, melody, duration, topk, topp, temperature, cfg_coef, progress=gr.Progress()):
120
  global INTERRUPTING
121
  INTERRUPTING = False
122
+ if temperature < 0:
123
+ raise gr.Error("Temperature must be >= 0.")
124
+ if topk < 0:
125
+ raise gr.Error("Topk must be non-negative.")
126
+ if topp < 0:
127
+ raise gr.Error("Topp must be non-negative.")
128
+
129
  topk = int(topk)
130
  load_model(model)
131