Update functions.py
Browse files- 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 |
-
|
| 519 |
-
|
| 520 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
|