mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-10 07:28:15 -05:00
validate llama3 output only with model "LLaMA-3/8B-SF-DPO" (#5138)
This commit is contained in:
@@ -402,16 +402,17 @@ if __name__ == "__main__":
|
||||
last_tok = tok
|
||||
generated += tokenizer.decode([tok])
|
||||
print(generated)
|
||||
EXPECTED_TEXT = {
|
||||
1: "Hello! How can I help you today? If you have any questions or need assistance with anything,",
|
||||
2: "Hello! How can I help you today? If you have any questions, need assistance or just want",
|
||||
3: "Hello! How can I help you today? If you have any questions or need assistance, feel free",
|
||||
4: "Hello! How can I assist you today? If you have any questions, need information, or require",
|
||||
5: "Hello! How can I assist you today? If you have any questions or need help with something",
|
||||
6: "Hello! How can I assist you today? If you have any questions, need information, or require",
|
||||
}
|
||||
assert generated == EXPECTED_TEXT[args.shard], f"{generated=} {EXPECTED_TEXT[args.shard]}"
|
||||
print("\n" + colored("output validated", "green")) # NOTE: "\n" inside colored does not render the color in github action
|
||||
if "LLaMA-3/8B-SF-DPO" in args.model.as_posix():
|
||||
EXPECTED_TEXT = {
|
||||
1: "Hello! How can I help you today? If you have any questions or need assistance with anything,",
|
||||
2: "Hello! How can I help you today? If you have any questions, need assistance or just want",
|
||||
3: "Hello! How can I help you today? If you have any questions or need assistance, feel free",
|
||||
4: "Hello! How can I assist you today? If you have any questions, need information, or require",
|
||||
5: "Hello! How can I assist you today? If you have any questions or need help with something",
|
||||
6: "Hello! How can I assist you today? If you have any questions, need information, or require",
|
||||
}
|
||||
assert generated == EXPECTED_TEXT[args.shard], f"{generated=} {EXPECTED_TEXT[args.shard]}"
|
||||
print("\n" + colored("output validated", "green")) # NOTE: "\n" inside colored does not render the color in github action
|
||||
else:
|
||||
prompt = [tokenizer.bos_id] + encode_message("system", "You are an helpful assistant.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user