nassi commited on
Commit
e8609a3
·
1 Parent(s): 55b8ad3

Create README.md

Browse files

To classifier a code source use

import torch
from transformers import RobertaTokenizer, RobertaConfig, RobertaModel

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
tokenizer = RobertaTokenizer.from_pretrained("microsoft/codebert-base")
model = RobertaModel.from_pretrained("microsoft/codebert-base")
model.to(device)

If you want more informations you can go to https://github.com/microsoft/CodeBERT

It tokenizes the source code as well

Files changed (1) hide show
  1. README.md +0 -0
README.md ADDED
File without changes