Update functions.py
Browse files- functions.py +4 -1
functions.py
CHANGED
@@ -508,15 +508,18 @@ def generate_eval(raw_text, N, chunk):
|
|
508 |
eval_set = []
|
509 |
for i, b in enumerate(sub_sequences):
|
510 |
ques_update = st.empty()
|
|
|
511 |
try:
|
512 |
qa = chain.run(b)
|
513 |
eval_set.append(qa)
|
514 |
ques_update.info("Creating Question:",i+1)
|
515 |
except Exception as e:
|
516 |
-
|
517 |
#st.write(e)
|
518 |
eval_set_full = list(itertools.chain.from_iterable(eval_set))
|
|
|
519 |
update.empty()
|
|
|
520 |
ques_update.empty()
|
521 |
|
522 |
return eval_set_full
|
|
|
508 |
eval_set = []
|
509 |
for i, b in enumerate(sub_sequences):
|
510 |
ques_update = st.empty()
|
511 |
+
warn_update = st.empty()
|
512 |
try:
|
513 |
qa = chain.run(b)
|
514 |
eval_set.append(qa)
|
515 |
ques_update.info("Creating Question:",i+1)
|
516 |
except Exception as e:
|
517 |
+
warn_update.warning('Error generating question %s.' % str(i+1), icon="⚠️")
|
518 |
#st.write(e)
|
519 |
eval_set_full = list(itertools.chain.from_iterable(eval_set))
|
520 |
+
|
521 |
update.empty()
|
522 |
+
warn_update.empty()
|
523 |
ques_update.empty()
|
524 |
|
525 |
return eval_set_full
|