Commit 2fdd54ec authored by rprenger's avatar rprenger
Browse files

Sending in prompts with the wrong type hangs the server. This is a check to make sure it's a list

parent f4a8b1d9
......@@ -41,6 +41,12 @@ class MegatronGenerate(Resource):
return "sentences is no longer used. Replace with prompts", 400
prompts = request.get_json()["prompts"]
if not isinstance(prompts, list):
return "prompts is not a list of strings", 400
if len(prompts) == 0:
return "prompts is empty", 400
if len(prompts) > 128:
return "Maximum number of prompts is 128", 400
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment