This repository contains relevant information of our research article 'Supervised fine-tuning enhances unsupervised learning from 45 million amino acids in TCR and peptide sequences'.

Embedding examples

Transformers

You can use RoBERTtcr with Transformers. To get started, install the necessary dependencies to setup your environment:

pip install -U transformers torch

Once setup you can proceed to run the model by running the snippet below:

from transformers import BertTokenizer, RobertaModel
import torch

device = 'cuda:0' if torch.cuda.is_available() else 'cpu'
tokenizer = BertTokenizer.from_pretrained('keiwoo/RoBERTtcr', do_lower_case = False)
model = RobertaModel.from_pretrained('keiwoo/RoBERTtcr').to(device)

outputs = model(**tokenizer(' '.join('CATAGGETQYF'), return_tensors="pt").to(device))

print(outputs.last_hidden_state[0].shape)
# torch.Size([13, 1024]) [CLS+N+SEP, 1024]

Fine-tuning

Please refer to https://github.com/keiwoo/RoBERTcr

Downloads last month
11
Safetensors
Model size
76.7M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for keiwoo/RoBERTtcr

Finetuned
(2372)
this model

Dataset used to train keiwoo/RoBERTtcr