nickmuchi commited on
Commit
db7f66b
1 Parent(s): ec3a17f

Update functions.py

Browse files
Files changed (1) hide show
  1. functions.py +9 -3
functions.py CHANGED
@@ -515,9 +515,15 @@ def generate_eval(raw_text, N, chunk):
515
  chain = QAGenerationChain.from_llm(ChatOpenAI(temperature=0))
516
  eval_set = []
517
  for i, b in enumerate(sub_sequences):
518
- qa = chain.run(b)
519
- eval_set.append(qa)
520
- ques_update.info(f"Creating Question: {i+1}")
 
 
 
 
 
 
521
 
522
  eval_set_full = list(itertools.chain.from_iterable(eval_set))
523
 
 
515
  chain = QAGenerationChain.from_llm(ChatOpenAI(temperature=0))
516
  eval_set = []
517
  for i, b in enumerate(sub_sequences):
518
+ try:
519
+
520
+ qa = chain.run(b)
521
+ eval_set.append(qa)
522
+ ques_update.info(f"Creating Question: {i+1}")
523
+
524
+ except:
525
+ st.warning(f'Error in generating Question: {i+1}...', icon="⚠️")
526
+ continue
527
 
528
  eval_set_full = list(itertools.chain.from_iterable(eval_set))
529