Alexandre-Numind commited on
Commit
9b07b7c
1 Parent(s): ae9b20d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -296,8 +296,8 @@ model.eval()
296
  def get_prediction(text,template,example):
297
  size = len(tokenizer(text)["input_ids"])
298
  print(size)
299
- # if size > 2000:
300
- # raise gr.Error("Max token for input text is 2000 tokes. Yours is: "+str(size))
301
  try:
302
  prompt = create_prompt(text,template,[example,"",""])
303
  except:
 
296
  def get_prediction(text,template,example):
297
  size = len(tokenizer(text)["input_ids"])
298
  print(size)
299
+ if size > 2000:
300
+ raise gr.Error("Max token for input text is 2000 tokes. Yours is: "+str(size))
301
  try:
302
  prompt = create_prompt(text,template,[example,"",""])
303
  except: