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

Model generation API simplified and cleanup tech debt on redundant variables #70

Merged
merged 3 commits into from
Jan 19, 2024

Conversation

frankaging
Copy link
Collaborator

@frankaging frankaging commented Jan 18, 2024

Descriptions:
Simplify generation intervention to have default mode of argument-less with just the base input. The default mode is inference-time intervention where we intervene on each decoding step now.

Cleanup intervention initialization with lazy dict variable passing, instead of hard coded arguments. Refactory existing code for readability.

Testing Done:

WARNING:root:Loading trainable intervention from intkey_layer.0.repr.block_output.unit.pos.nunit.1#0.bin.
WARNING:root:Loading trainable intervention from intkey_layer.1.repr.block_output.unit.pos.nunit.1#0.bin.
Directory './test_output_dir_prefix-9647b9' created successfully.
WARNING:root:Saving trainable intervention to intkey_layer.0.repr.block_output.unit.pos.nunit.1#0.bin.
WARNING:root:Saving trainable intervention to intkey_layer.1.repr.block_output.unit.pos.nunit.1#0.bin.
WARNING:root:The key is provided in the config. Assuming this is loaded from a pretrained module.
WARNING:root:Loading trainable intervention from intkey_layer.0.repr.block_output.unit.pos.nunit.1#0.bin.
WARNING:root:Loading trainable intervention from intkey_layer.1.repr.block_output.unit.pos.nunit.1#0.bin.
.Directory './test_output_dir_prefix-2701e4' created successfully.
.Directory './test_output_dir_prefix-87c463' created successfully.
WARNING:root:Saving trainable intervention to intkey_layer.0.repr.block_output.unit.pos.nunit.1#0.bin.
WARNING:root:Saving trainable intervention to intkey_layer.1.repr.block_output.unit.pos.nunit.1#0.bin.
.Removing testing dir ./test_output_dir_prefix-8f8fad
Removing testing dir ./test_output_dir_prefix-364dae
Removing testing dir ./test_output_dir_prefix-9647b9
Removing testing dir ./test_output_dir_prefix-2701e4
Removing testing dir ./test_output_dir_prefix-87c463

----------------------------------------------------------------------
Ran 31 tests in 84.541s

OK```

@frankaging frankaging changed the title Zen/updategenerate Model generation API simplified and cleanup tech debt on redundant variables Jan 19, 2024
@frankaging frankaging merged commit fbc2c7e into main Jan 19, 2024
1 check passed
@frankaging frankaging deleted the zen/updategenerate branch January 19, 2024 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant