MarcosFRGames commited on
Commit
9666cde
verified
1 Parent(s): 1d08386

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -291,6 +291,13 @@ def generate_endpoint(user_message):
291
  mimetype='text/plain'
292
  )
293
 
 
 
 
 
 
 
 
294
  # Limitar max_tokens a la configuraci贸n m谩xima
295
  if max_tokens > MAX_GENERATION_TOKENS:
296
  max_tokens = MAX_GENERATION_TOKENS
 
291
  mimetype='text/plain'
292
  )
293
 
294
+ if not 0 <= top_k <= 100:
295
+ return Response(
296
+ f"Error: El par谩metro 'top_k' debe estar entre 0 y 100",
297
+ status=400,
298
+ mimetype='text/plain'
299
+ )
300
+
301
  # Limitar max_tokens a la configuraci贸n m谩xima
302
  if max_tokens > MAX_GENERATION_TOKENS:
303
  max_tokens = MAX_GENERATION_TOKENS