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

Revert "Revert "Add granite modeling llama main"" #323

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
5 changes: 3 additions & 2 deletions caikit_nlp/modules/text_generation/peft_prompt_tuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ def train(

# Remove _name_or_path field as a model can be
# saved in different location but still same
del base_model_config["_name_or_path"]
base_model_config.pop("_name_or_path", None)
error.value_check(
"<NLP07232147E>",
"_name_or_path" not in base_model_config,
Expand Down Expand Up @@ -585,7 +585,8 @@ def load(
if peft_config.task_type == "CAUSAL_LM":
# get the transformers Causal LM model
base_model = AutoModelForCausalLM.from_pretrained(
peft_config.base_model_name_or_path
peft_config.base_model_name_or_path,
torch_dtype=torch_dtype,
)
# get the PEFT causal LM model
model = PeftModel.from_pretrained(base_model, model_config)
Expand Down
5 changes: 5 additions & 0 deletions caikit_nlp/resources/pretrained_model/hf_auto_causal_lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@

# Local
from ...data_model import GenerationTrainRecord, PromptOutputModelType

# Note: Below module is imported to allow loading of fm stack sphinx models
from ...toolkit.text_generation import ( # pylint: disable=unused-import
granite_modeling_llama,
)
from ...toolkit.verbalizer_utils import render_verbalizer
from .base import PretrainedModelBase

Expand Down
Loading
Loading