We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 77c1782 commit ac3192fCopy full SHA for ac3192f
repoqa/provider/google.py
@@ -31,9 +31,8 @@ def generate_reply(
31
system_msg=system_msg,
32
)
33
34
- assert (
35
- len(replies.candidates) == n
36
- ), f"# replies = {len(replies.candidates)} != {n = }"
+ if len(replies.candidates) != n:
+ print(f"[WARNING] # replies = {len(replies.candidates)} != {n = }")
37
38
ret_texts = []
39
for candidate in replies.candidates:
@@ -45,4 +44,4 @@ def generate_reply(
45
44
ret_texts.append("")
46
print(f"{candidate.safety_ratings = }")
47
48
- return ret_texts
+ return ret_texts + [""] * (n - len(ret_texts))
0 commit comments