rameshmoorthy commited on
Commit
01436f2
1 Parent(s): d12f0a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -337,6 +337,7 @@ with gr.Blocks(title="Quiz Maker", theme=gr.themes.Default(primary_hue="green",
337
  do_sample=True,
338
  seed=42,
339
  )
 
340
  count=0
341
  while count<=3:
342
  try:
@@ -353,7 +354,7 @@ with gr.Blocks(title="Quiz Maker", theme=gr.themes.Default(primary_hue="green",
353
 
354
  quiz_data = output_json
355
 
356
- question_radio_list = []
357
 
358
  for question_num in range(1, 11):
359
  question_key = f"Q{question_num}"
@@ -383,8 +384,12 @@ with gr.Blocks(title="Quiz Maker", theme=gr.themes.Default(primary_hue="green",
383
  except Exception as e:
384
  count+=1
385
  print(f"Exception occurred: {e}")
386
- print("Trying again...please wait")
387
- continue
 
 
 
 
388
 
389
  print('Question radio list ' , question_radio_list)
390
 
 
337
  do_sample=True,
338
  seed=42,
339
  )
340
+ question_radio_list = []
341
  count=0
342
  while count<=3:
343
  try:
 
354
 
355
  quiz_data = output_json
356
 
357
+
358
 
359
  for question_num in range(1, 11):
360
  question_key = f"Q{question_num}"
 
384
  except Exception as e:
385
  count+=1
386
  print(f"Exception occurred: {e}")
387
+ if count==3:
388
+ print('Retry exhausted')
389
+ gr.Warning('Sorry. Pls try with another topic !')
390
+ else:
391
+ print(f"Trying again..{count} time...please wait")
392
+ continue
393
 
394
  print('Question radio list ' , question_radio_list)
395