Skip to content

Using tcrbert offline  #10

@sakinaamin

Description

@sakinaamin

Hi Kevin, thanks for creating this model. I am trying to apply it for my dataset on a remote cluster, so I saved tcrbert_model offline as:
tcrbert_model = BertModel.from_pretrained("wukevin/tcr-bert") #in internet
tcrbert_model.save_pretrained("./tcrbert_model") #saved in working directory

tcrbert_model = BertModel.from_pretrained("path/to/working/directory/tcrbert_model")
tcrbert_trb_cls = model_utils.load_classification_pipeline("path/to/working/directory/tcrbert_model", device=0)

Some weights of BertForSequenceClassification were not initialized from the model checkpoint at /path/to/working/directory/tcrbert_model and are newly initialized: ['classifier.bias', 'classifier.weight']
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.
Traceback (most recent call last):
File "", line 1, in
File "path/to/working/directory/tcr-bert/tcr/model_utils.py", line 307, in load_classification_pipeline
pipeline = TextClassificationPipeline(
File "path/to/working/directory/tcrbert/lib/python3.9/site-packages/transformers/pipelines/text_classification.py", line 83, in init
super().init(**kwargs)
File "path/to/working/directory/tcrbert/lib/python3.9/site-packages/transformers/pipelines/base.py", line 861, in init
raise ValueError(f"{device} unrecognized or not available.")
ValueError: 0 unrecognized or not available.

Many thanks!

Best,
Sakina

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions