Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance lora tests with more layer and rank variations #3243

Merged
merged 18 commits into from
Mar 10, 2024
Prev Previous commit
Next Next commit
minor fix
  • Loading branch information
tterrysun committed Mar 7, 2024
commit 02ec9f9bda2f3c29c6f53e58a4de627ce89f515b
3 changes: 2 additions & 1 deletion tests/lora/test_layer_variation.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def do_sample(llm,
generated_texts.append(generated_text)
print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
generated_logprobs.append([
list(logprob.keys()) for logprob in outputs[0].outputs[0].logprobs
list(logprob.keys()) for logprob in output.outputs[0].logprobs
][:n_tokens])
return generated_logprobs if logprobs else generated_texts

Expand Down Expand Up @@ -78,6 +78,7 @@ def test_layer_variation_verify_reference(target_modules, rank, tmpdir):
model.save_pretrained(tmp_dir_lora)
merged_probs = do_sample(llm, tmp_dir_lora, 1, logprobs=5, n_tokens=1)
reference_id_sets = [set(prob[0]) for prob in merged_probs]
breakpoint()
assert reference_id_sets == [{450, 13, 306, 11221, 2266},
{450, 13, 306, 11221, 2266},
{450, 13, 306, 11221, 2266}]
Expand Down
Loading