amitagh commited on
Commit
a2b22b4
1 Parent(s): e49ad54

trucate text

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -27,6 +27,8 @@ def generate_quiz(ctxt_txt,ques_type, num_questions):
27
  return [[], "Please select both Context Text and number of questions before generating the quiz."] + [gr.update(visible=False) for _ in range(2 * MAX_ANS_COMP)]
28
 
29
  num_questions = int(num_questions)
 
 
30
 
31
  quiz = gen_quiz_ques_local(ctxt_txt, ques_type, num_questions)
32
  if quiz == None:
 
27
  return [[], "Please select both Context Text and number of questions before generating the quiz."] + [gr.update(visible=False) for _ in range(2 * MAX_ANS_COMP)]
28
 
29
  num_questions = int(num_questions)
30
+ if len(ctxt_txt) > 10000:
31
+ ctxt_txt = ctxt_txt[:10000]
32
 
33
  quiz = gen_quiz_ques_local(ctxt_txt, ques_type, num_questions)
34
  if quiz == None: