8000 Cannot load the broad+adapter model · Issue #15 · kr-colab/cxt · GitHub
[go: up one dir, main page]

Skip to content

Cannot load the broad+adapter model #15

Open

Description

@RubyRedlich

Hi! I am trying to load the broad+adapter model:

model = setup_cxt_model(model_type="broad+adapter")

However, I get the following error:

FileNotFoundError: [Errno 2] No such file or directory: '/home/kkor/cxt/cxt/lightning_logs/version_20/checkpoints/epoch=1-step=5280.ckpt'

Loading the broad and narrow models worked just fine.

Please let me know how I might be able to fix this error to load the broad+adapter model! Thank you so much!

(Edit: I believe the error is coming from the call to LitTokenFreeDecoder.load_from_checkpoint() in setup_cxt_model(). Apparently, pytorch lightning loads from the checkpoint with the hyperparameters used at training time. Therefore, to make pretrained_ckpt=None, this might need to be explicitly passed to LitTokenFreeDecoder.load_from_checkpoint(). Otherwise, it tries to load from the local directory that was used during training)

P.S. I was also getting an Unpickling Error since weights_only was set to True. The following work around fixed it:

import torch
from functools import wraps

original_load = torch.load

@wraps(original_load)
def patched_load(*args, **kwargs):
    kwargs['weights_only'] = False
    return original_load(*args, **kwargs)

torch.load = patched_load

Activity

  1. kevinkorfmann commented on Feb 27, 2026

    @kevinkorfmann
    Collaborator

    Hi Ruby - thanks for letting me know, I am currently cleaning up the API more, and would have something more useable in few days - sorry about that and thank you for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0