Spaces:
Runtime error
Runtime error
Edit raise error
Browse files
app.py
CHANGED
@@ -52,23 +52,23 @@ def single_generation(text,min_length,max_length,temperature,top_k,top_p,num_bea
|
|
52 |
num_return_sequences=1)
|
53 |
return result[0]["generated_text"]
|
54 |
elif temperature or repetition_penalty is None:
|
55 |
-
|
56 |
elif repetition_penalty < 1:
|
57 |
-
|
58 |
elif temperature <= 0:
|
59 |
-
|
60 |
elif min_length > max_length:
|
61 |
-
|
62 |
elif type(num_beams) != int:
|
63 |
-
|
64 |
elif type(top_k) != int:
|
65 |
-
|
66 |
elif type(min_length) != int or type(max_length) != int:
|
67 |
-
|
68 |
elif text == '':
|
69 |
-
|
70 |
else:
|
71 |
-
|
72 |
|
73 |
|
74 |
# create the variable needed for the gradio app
|
|
|
52 |
num_return_sequences=1)
|
53 |
return result[0]["generated_text"]
|
54 |
elif temperature or repetition_penalty is None:
|
55 |
+
raise error_empty_temprep
|
56 |
elif repetition_penalty < 1:
|
57 |
+
raise error_rep
|
58 |
elif temperature <= 0:
|
59 |
+
raise error_temp
|
60 |
elif min_length > max_length:
|
61 |
+
raise error_minmax
|
62 |
elif type(num_beams) != int:
|
63 |
+
raise error_numbeams_type
|
64 |
elif type(top_k) != int:
|
65 |
+
raise error_topk_type
|
66 |
elif type(min_length) != int or type(max_length) != int:
|
67 |
+
raise error_minmax_type
|
68 |
elif text == '':
|
69 |
+
raise error_empty_text
|
70 |
else:
|
71 |
+
raise error_unknown
|
72 |
|
73 |
|
74 |
# create the variable needed for the gradio app
|