mirror of
https://github.com/wassname/peft.git
synced 2026-09-09 11:28:32 +08:00
add examples
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -31,7 +31,7 @@ from .utils import (
|
||||
TaskType,
|
||||
bloom_model_postprocess_past_key_value,
|
||||
get_pet_model_state_dict,
|
||||
pet_model_load_and_dispatch,
|
||||
set_pet_model_state_dict,
|
||||
shift_tokens_right,
|
||||
pet_model_load_and_dispatch,
|
||||
)
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
|
||||
from .config import PETConfig, PETType, PromptLearningConfig, TaskType
|
||||
from .other import _set_trainable, bloom_model_postprocess_past_key_value, shift_tokens_right
|
||||
from .save_and_load import get_pet_model_state_dict, set_pet_model_state_dict, pet_model_load_and_dispatch
|
||||
from .save_and_load import get_pet_model_state_dict, pet_model_load_and_dispatch, set_pet_model_state_dict
|
||||
|
||||
@@ -88,5 +88,6 @@ def pet_model_load_and_dispatch(model, pet_model_state_dict, pet_config, max_mem
|
||||
if model.pet_config.pet_type == PETType.LORA:
|
||||
add_hook_to_module(model.base_model.model, hook)
|
||||
else:
|
||||
remove_hook_from_submodules(model.prompt_encoder)
|
||||
add_hook_to_module(model.base_model, hook)
|
||||
return model
|
||||
|
||||
Reference in New Issue
Block a user