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

Using tcrbert offline #10

Open
sakinaamin opened this issue Feb 27, 2024 · 0 comments
Open

Using tcrbert offline #10

sakinaamin opened this issue Feb 27, 2024 · 0 comments

Comments

@sakinaamin
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant