Skip to content

Commit

Permalink
Fix llm.export_ckpt
Browse files Browse the repository at this point in the history
Signed-off-by: Hemil Desai <[email protected]>
  • Loading branch information
hemildesai committed Dec 1, 2024
1 parent 8becd57 commit 2f68efe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nemo/collections/llm/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ def import_ckpt(


def load_connector_from_trainer_ckpt(path: Path, target: str) -> io.ModelConnector:
return io.load_context(path).model.exporter(target, path)
return io.load_context(path, subpath="model").exporter(target, path)


@run.cli.entrypoint(name="export", namespace="llm")
Expand Down
4 changes: 2 additions & 2 deletions nemo/collections/llm/gpt/model/llama.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,11 @@ def convert_state(self, source, target):

@property
def tokenizer(self):
return io.load_context(str(self)).model.tokenizer.tokenizer
return io.load_context(str(self), subpath="model").tokenizer.tokenizer

@property
def config(self) -> "HFLlamaConfig":
source: LlamaConfig = io.load_context(str(self)).model.config
source: LlamaConfig = io.load_context(str(self), subpath="model.config")

from transformers import LlamaConfig as HFLlamaConfig

Expand Down

0 comments on commit 2f68efe

Please sign in to comment.