Skip to content
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 @@ -436,6 +436,12 @@ def save_checkpoint_as_nemo_file(self):
self.virtual_prompt_style = current_virtual_prompt_style
self.virtual_prompt_source = current_virtual_prompt_source

# Revert prompt table back to previous state
if self.virtual_prompt_style == VirtualPromptStyle.P_TUNING and self.first_stage_of_pipeline():
for taskname in current_new_tasks:
if taskname in self.prompt_table.prompt_table:
del self.prompt_table.prompt_table[taskname]

with open_dict(self.cfg):
self.cfg.existing_tasks = current_existing_tasks
self.cfg.new_tasks = current_new_tasks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,12 @@ def save_checkpoint_as_nemo_file(self):
self.virtual_prompt_style = current_virtual_prompt_style
self.virtual_prompt_source = current_virtual_prompt_source

# Revert prompt table back to previous state
if self.virtual_prompt_style == VirtualPromptStyle.P_TUNING and self.frozen_model.model.pre_process:
for taskname in current_new_tasks:
if taskname in self.prompt_table.prompt_table:
del self.prompt_table.prompt_table[taskname]

with open_dict(self.cfg):
self.cfg.existing_tasks = current_existing_tasks
self.cfg.new_tasks = current_new_tasks
Expand Down