Saving results (hash always diffrent) = skipping doesnt work

This commit is contained in:
Lennart J. Kurzweg (Nx2)
2024-08-07 21:27:40 +02:00
parent abd6320ce9
commit a448b957ae
4 changed files with 87 additions and 28 deletions

View File

@@ -19,9 +19,9 @@ def main():
# "tinyllama:1.1b",
]
seeds = [
# 2,
222,
22222,
2,
# 222,
# 22222,
# 2222222
]
tests = [
@@ -34,9 +34,13 @@ def main():
},
validator=system_human_answer_match,
validation_input={
"criteria": """- in Mandarin Chinese
- factually correct
- just one single conversational answer, without any AI fragments (A/B versions, "end of message" parts, unfitting discalimers or notes)""",
"criteria": """- in Mandarin Chinese from front to finnish
- factually correct
- about healthy vegetables
- just one single conversational answer, without any AI fragments (A/B versions, "end of message" parts, unfitting discalimers or notes)
Again, the message has to be entirely in Manadarin Chineese.
That means If the answer is not in Chinese the answer is NOT correct! Only if the message in in Chinese rate as correct""",
}
),
Test(
@@ -53,6 +57,7 @@ def main():
validator=regex_match_any,
validation_input={
"patterns": ["33549659245", "33,549,659,245", "33.549.659.245"]
# "patterns": ["3[,\. ]?3[,\. ]?5[,\. ]?4[,\. ]?9[,\. ]?6[,\. ]?5[,\. ]?9[,\. ]?2[,\. ]?4[,\. ]?5"] # Would accept 3.354.965.9245
}
),
]
@@ -65,7 +70,14 @@ def main():
)
print()
for result in results: print(f"\n\033[0;36mtest_name:\033[0m {result['test'].name}\n\033[0;36mmodel:\033[0m {result['model']}\n\033[0;36mseed:\033[0m {result['seed']}\n\033[0;36mvalidation_result:\033[0m {result['validation']}\n\033[0;36manswer: ⏎\033[0m\n{result['result']}")
for hash_key in results:
result = results[hash_key]
print(f"""
\033[0;36mtest_name:\033[0m {result['test_name']}
\033[0;36mmodel:\033[0m {result['model']}
\033[0;36mseed:\033[0m {result['seed']}
\033[0;36mvalidation_result:\033[0m {result['validation']}
\033[0;36manswer: »\033[0m{result['answer']}\033[0;36m«\033[0m""")
if __name__ == "__main__":
main()