mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-06-24 02:14:17 +00:00
validate llama3 output only with model "LLaMA-3/8B-SF-DPO" (#5138)
This commit is contained in:
parent
981afb114f
commit
dade7677cf
1 changed files with 11 additions and 10 deletions
|
|
@ -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.")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue