Skip to content

Commit 9b9fbd9

Browse files
committed
Issue #1611 Fixes
Got it working, replicated code from issue and it runs well. Needed to account for ValueError which catches the JSON Parsing issues
1 parent e678f24 commit 9b9fbd9

4 files changed

Lines changed: 873 additions & 32 deletions

File tree

deepeval/benchmarks/truthful_qa/truthful_qa.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def predict(
185185
)
186186
prediction = str(res.answer)
187187

188-
except TypeError:
188+
except (TypeError, ValueError, AttributeError):
189189
prompt += self.confinement_instructions_dict[mode]
190190
prediction = model.generate(prompt)
191191

@@ -233,7 +233,7 @@ def batch_predict(
233233
)
234234
predictions = [str(res.answer) for res in responses]
235235

236-
except TypeError:
236+
except (TypeError, ValueError, AttributeError):
237237
if mode == TruthfulQAMode.MC1:
238238
prompts = [
239239
prompt

0 commit comments

Comments
 (0)