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

GPT P tuning Eval changes (#5952) #6272

Merged
merged 4 commits into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ inference:
repetition_penalty: 1.2 # The parameter for repetition penalty. 1.0 means no penalty.
min_tokens_to_generate: 0 # The minimum length of the sequence to be generated.
compute_logprob: False # a flag used to compute logprob of all the input text, a very special case of running inference, default False
batch_size: 1


trainer:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ def main(cfg) -> None:
if cfg.get("gpt_model_file"):
with open_dict(prompt_learning_cfg):
prompt_learning_cfg.language_model_path = cfg.gpt_model_file
prompt_learning_cfg.sequence_parallel = False
prompt_learning_cfg.activations_checkpoint_method = None
prompt_learning_cfg.activations_checkpoint_granularity = None
prompt_learning_cfg.activations_checkpoint_num_layers = None

# Load prompt tuned model, virtual_prompt_model_file must be provided in config
# Now load prompt learning model with frozen gpt model base
Expand Down Expand Up @@ -136,7 +140,7 @@ def placeholder():

_, dataloader = model.build_virtual_prompt_dataset(
data=cfg.data_paths,
batch_size=64,
batch_size=cfg.inference.get('batch_size', 1),
max_seq_length=max_input_length,
min_seq_length=model.cfg.data.get('min_seq_length', 1),
add_bos=sampling_params["add_BOS"],
Expand Down