Instructions to use dzungpham/graphcodebert-code-classification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dzungpham/graphcodebert-code-classification with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("dzungpham/graphcodebert-code-classification", dtype="auto") - Notebooks
- Google Colab
- Kaggle
| 2026-04-15 12:35:23,651 - INFO - train_pipeline - Logging to ./output_checkpoints/codebert-base-cross-entropy/training.log | |
| 2026-04-15 12:35:23,668 - INFO - train_pipeline - Loading model & tokenizer for 'microsoft/codebert-base' | |
| 2026-04-15 12:35:25,145 - INFO - train_pipeline - Model placed on cuda | |
| 2026-04-15 12:35:25,156 - INFO - train_pipeline - ===== Model Architecture ===== | |
| 2026-04-15 12:35:25,169 - INFO - train_pipeline - | |
| RobertaForSequenceClassification( | |
| (roberta): RobertaModel( | |
| (embeddings): RobertaEmbeddings( | |
| (word_embeddings): Embedding(50265, 768, padding_idx=1) | |
| (position_embeddings): Embedding(514, 768, padding_idx=1) | |
| (token_type_embeddings): Embedding(1, 768) | |
| (LayerNorm): LayerNorm((768,), eps=1e-05, elementwise_affine=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| (encoder): RobertaEncoder( | |
| (layer): ModuleList( | |
| (0-11): 12 x RobertaLayer( | |
| (attention): RobertaAttention( | |
| (self): RobertaSdpaSelfAttention( | |
| (query): Linear(in_features=768, out_features=768, bias=True) | |
| (key): Linear(in_features=768, out_features=768, bias=True) | |
| (value): Linear(in_features=768, out_features=768, bias=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| (output): RobertaSelfOutput( | |
| (dense): Linear(in_features=768, out_features=768, bias=True) | |
| (LayerNorm): LayerNorm((768,), eps=1e-05, elementwise_affine=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| ) | |
| (intermediate): RobertaIntermediate( | |
| (dense): Linear(in_features=768, out_features=3072, bias=True) | |
| (intermediate_act_fn): GELUActivation() | |
| ) | |
| (output): RobertaOutput( | |
| (dense): Linear(in_features=3072, out_features=768, bias=True) | |
| (LayerNorm): LayerNorm((768,), eps=1e-05, elementwise_affine=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| ) | |
| ) | |
| ) | |
| ) | |
| (classifier): RobertaClassificationHead( | |
| (dense): Linear(in_features=768, out_features=768, bias=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| (out_proj): Linear(in_features=768, out_features=2, bias=True) | |
| ) | |
| ) | |
| 2026-04-15 12:35:25,191 - INFO - train_pipeline - ===== Tokenizer Summary ===== | |
| 2026-04-15 12:35:25,243 - INFO - train_pipeline - Vocab size: 50265 | Special tokens: ['<s>', '</s>', '<unk>', '<pad>', '<mask>'] | |
| 2026-04-15 12:35:25,254 - INFO - train_pipeline - ===== End of Architecture Log ===== | |
| 2026-04-15 12:35:25,265 - INFO - train_pipeline - Base model weights frozen – only classifier head will be trained. | |
| 2026-04-15 12:35:26,856 - INFO - train_pipeline - === Starting training === | |
| 2026-04-15 12:35:23,651 - INFO - train_pipeline - Logging to ./output_checkpoints/codebert-base-cross-entropy/training.log | |
| 2026-04-15 12:35:23,668 - INFO - train_pipeline - Loading model & tokenizer for 'microsoft/codebert-base' | |
| 2026-04-15 12:35:25,145 - INFO - train_pipeline - Model placed on cuda | |
| 2026-04-15 12:35:25,156 - INFO - train_pipeline - ===== Model Architecture ===== | |
| 2026-04-15 12:35:25,169 - INFO - train_pipeline - | |
| RobertaForSequenceClassification( | |
| (roberta): RobertaModel( | |
| (embeddings): RobertaEmbeddings( | |
| (word_embeddings): Embedding(50265, 768, padding_idx=1) | |
| (position_embeddings): Embedding(514, 768, padding_idx=1) | |
| (token_type_embeddings): Embedding(1, 768) | |
| (LayerNorm): LayerNorm((768,), eps=1e-05, elementwise_affine=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| (encoder): RobertaEncoder( | |
| (layer): ModuleList( | |
| (0-11): 12 x RobertaLayer( | |
| (attention): RobertaAttention( | |
| (self): RobertaSdpaSelfAttention( | |
| (query): Linear(in_features=768, out_features=768, bias=True) | |
| (key): Linear(in_features=768, out_features=768, bias=True) | |
| (value): Linear(in_features=768, out_features=768, bias=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| (output): RobertaSelfOutput( | |
| (dense): Linear(in_features=768, out_features=768, bias=True) | |
| (LayerNorm): LayerNorm((768,), eps=1e-05, elementwise_affine=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| ) | |
| (intermediate): RobertaIntermediate( | |
| (dense): Linear(in_features=768, out_features=3072, bias=True) | |
| (intermediate_act_fn): GELUActivation() | |
| ) | |
| (output): RobertaOutput( | |
| (dense): Linear(in_features=3072, out_features=768, bias=True) | |
| (LayerNorm): LayerNorm((768,), eps=1e-05, elementwise_affine=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| ) | |
| ) | |
| ) | |
| ) | |
| (classifier): RobertaClassificationHead( | |
| (dense): Linear(in_features=768, out_features=768, bias=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| (out_proj): Linear(in_features=768, out_features=2, bias=True) | |
| ) | |
| ) | |
| 2026-04-15 12:35:25,191 - INFO - train_pipeline - ===== Tokenizer Summary ===== | |
| 2026-04-15 12:35:25,243 - INFO - train_pipeline - Vocab size: 50265 | Special tokens: ['<s>', '</s>', '<unk>', '<pad>', '<mask>'] | |
| 2026-04-15 12:35:25,254 - INFO - train_pipeline - ===== End of Architecture Log ===== | |
| 2026-04-15 12:35:25,265 - INFO - train_pipeline - Base model weights frozen – only classifier head will be trained. | |
| 2026-04-15 12:35:26,856 - INFO - train_pipeline - === Starting training === | |
| 2026-04-15 12:35:23,651 - INFO - train_pipeline - Logging to ./output_checkpoints/codebert-base-cross-entropy/training.log | |
| 2026-04-15 12:35:23,668 - INFO - train_pipeline - Loading model & tokenizer for 'microsoft/codebert-base' | |
| 2026-04-15 12:35:25,145 - INFO - train_pipeline - Model placed on cuda | |
| 2026-04-15 12:35:25,156 - INFO - train_pipeline - ===== Model Architecture ===== | |
| 2026-04-15 12:35:25,169 - INFO - train_pipeline - | |
| RobertaForSequenceClassification( | |
| (roberta): RobertaModel( | |
| (embeddings): RobertaEmbeddings( | |
| (word_embeddings): Embedding(50265, 768, padding_idx=1) | |
| (position_embeddings): Embedding(514, 768, padding_idx=1) | |
| (token_type_embeddings): Embedding(1, 768) | |
| (LayerNorm): LayerNorm((768,), eps=1e-05, elementwise_affine=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| (encoder): RobertaEncoder( | |
| (layer): ModuleList( | |
| (0-11): 12 x RobertaLayer( | |
| (attention): RobertaAttention( | |
| (self): RobertaSdpaSelfAttention( | |
| (query): Linear(in_features=768, out_features=768, bias=True) | |
| (key): Linear(in_features=768, out_features=768, bias=True) | |
| (value): Linear(in_features=768, out_features=768, bias=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| (output): RobertaSelfOutput( | |
| (dense): Linear(in_features=768, out_features=768, bias=True) | |
| (LayerNorm): LayerNorm((768,), eps=1e-05, elementwise_affine=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| ) | |
| (intermediate): RobertaIntermediate( | |
| (dense): Linear(in_features=768, out_features=3072, bias=True) | |
| (intermediate_act_fn): GELUActivation() | |
| ) | |
| (output): RobertaOutput( | |
| (dense): Linear(in_features=3072, out_features=768, bias=True) | |
| (LayerNorm): LayerNorm((768,), eps=1e-05, elementwise_affine=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| ) | |
| ) | |
| ) | |
| ) | |
| (classifier): RobertaClassificationHead( | |
| (dense): Linear(in_features=768, out_features=768, bias=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| (out_proj): Linear(in_features=768, out_features=2, bias=True) | |
| ) | |
| ) | |
| 2026-04-15 12:35:25,191 - INFO - train_pipeline - ===== Tokenizer Summary ===== | |
| 2026-04-15 12:35:25,243 - INFO - train_pipeline - Vocab size: 50265 | Special tokens: ['<s>', '</s>', '<unk>', '<pad>', '<mask>'] | |
| 2026-04-15 12:35:25,254 - INFO - train_pipeline - ===== End of Architecture Log ===== | |
| 2026-04-15 12:35:25,265 - INFO - train_pipeline - Base model weights frozen – only classifier head will be trained. | |
| 2026-04-15 12:35:26,856 - INFO - train_pipeline - === Starting training === | |
| 2026-04-15 12:35:23,651 - INFO - train_pipeline - Logging to ./output_checkpoints/codebert-base-cross-entropy/training.log | |
| 2026-04-15 12:35:23,668 - INFO - train_pipeline - Loading model & tokenizer for 'microsoft/codebert-base' | |
| 2026-04-15 12:35:25,145 - INFO - train_pipeline - Model placed on cuda | |
| 2026-04-15 12:35:25,156 - INFO - train_pipeline - ===== Model Architecture ===== | |
| 2026-04-15 12:35:25,169 - INFO - train_pipeline - | |
| RobertaForSequenceClassification( | |
| (roberta): RobertaModel( | |
| (embeddings): RobertaEmbeddings( | |
| (word_embeddings): Embedding(50265, 768, padding_idx=1) | |
| (position_embeddings): Embedding(514, 768, padding_idx=1) | |
| (token_type_embeddings): Embedding(1, 768) | |
| (LayerNorm): LayerNorm((768,), eps=1e-05, elementwise_affine=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| (encoder): RobertaEncoder( | |
| (layer): ModuleList( | |
| (0-11): 12 x RobertaLayer( | |
| (attention): RobertaAttention( | |
| (self): RobertaSdpaSelfAttention( | |
| (query): Linear(in_features=768, out_features=768, bias=True) | |
| (key): Linear(in_features=768, out_features=768, bias=True) | |
| (value): Linear(in_features=768, out_features=768, bias=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| (output): RobertaSelfOutput( | |
| (dense): Linear(in_features=768, out_features=768, bias=True) | |
| (LayerNorm): LayerNorm((768,), eps=1e-05, elementwise_affine=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| ) | |
| (intermediate): RobertaIntermediate( | |
| (dense): Linear(in_features=768, out_features=3072, bias=True) | |
| (intermediate_act_fn): GELUActivation() | |
| ) | |
| (output): RobertaOutput( | |
| (dense): Linear(in_features=3072, out_features=768, bias=True) | |
| (LayerNorm): LayerNorm((768,), eps=1e-05, elementwise_affine=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| ) | |
| ) | |
| ) | |
| ) | |
| (classifier): RobertaClassificationHead( | |
| (dense): Linear(in_features=768, out_features=768, bias=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| (out_proj): Linear(in_features=768, out_features=2, bias=True) | |
| ) | |
| ) | |
| 2026-04-15 12:35:25,191 - INFO - train_pipeline - ===== Tokenizer Summary ===== | |
| 2026-04-15 12:35:25,243 - INFO - train_pipeline - Vocab size: 50265 | Special tokens: ['<s>', '</s>', '<unk>', '<pad>', '<mask>'] | |
| 2026-04-15 12:35:25,254 - INFO - train_pipeline - ===== End of Architecture Log ===== | |
| 2026-04-15 12:35:25,265 - INFO - train_pipeline - Base model weights frozen – only classifier head will be trained. | |
| 2026-04-15 12:35:26,856 - INFO - train_pipeline - === Starting training === | |
| 2026-04-15 12:35:23,651 - INFO - train_pipeline - Logging to ./output_checkpoints/codebert-base-cross-entropy/training.log | |
| 2026-04-15 12:35:23,668 - INFO - train_pipeline - Loading model & tokenizer for 'microsoft/codebert-base' | |
| 2026-04-15 12:35:25,145 - INFO - train_pipeline - Model placed on cuda | |
| 2026-04-15 12:35:25,156 - INFO - train_pipeline - ===== Model Architecture ===== | |
| 2026-04-15 12:35:25,169 - INFO - train_pipeline - | |
| RobertaForSequenceClassification( | |
| (roberta): RobertaModel( | |
| (embeddings): RobertaEmbeddings( | |
| (word_embeddings): Embedding(50265, 768, padding_idx=1) | |
| (position_embeddings): Embedding(514, 768, padding_idx=1) | |
| (token_type_embeddings): Embedding(1, 768) | |
| (LayerNorm): LayerNorm((768,), eps=1e-05, elementwise_affine=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| (encoder): RobertaEncoder( | |
| (layer): ModuleList( | |
| (0-11): 12 x RobertaLayer( | |
| (attention): RobertaAttention( | |
| (self): RobertaSdpaSelfAttention( | |
| (query): Linear(in_features=768, out_features=768, bias=True) | |
| (key): Linear(in_features=768, out_features=768, bias=True) | |
| (value): Linear(in_features=768, out_features=768, bias=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| (output): RobertaSelfOutput( | |
| (dense): Linear(in_features=768, out_features=768, bias=True) | |
| (LayerNorm): LayerNorm((768,), eps=1e-05, elementwise_affine=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| ) | |
| (intermediate): RobertaIntermediate( | |
| (dense): Linear(in_features=768, out_features=3072, bias=True) | |
| (intermediate_act_fn): GELUActivation() | |
| ) | |
| (output): RobertaOutput( | |
| (dense): Linear(in_features=3072, out_features=768, bias=True) | |
| (LayerNorm): LayerNorm((768,), eps=1e-05, elementwise_affine=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| ) | |
| ) | |
| ) | |
| ) | |
| (classifier): RobertaClassificationHead( | |
| (dense): Linear(in_features=768, out_features=768, bias=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| (out_proj): Linear(in_features=768, out_features=2, bias=True) | |
| ) | |
| ) | |
| 2026-04-15 12:35:25,191 - INFO - train_pipeline - ===== Tokenizer Summary ===== | |
| 2026-04-15 12:35:25,243 - INFO - train_pipeline - Vocab size: 50265 | Special tokens: ['<s>', '</s>', '<unk>', '<pad>', '<mask>'] | |
| 2026-04-15 12:35:25,254 - INFO - train_pipeline - ===== End of Architecture Log ===== | |
| 2026-04-15 12:35:25,265 - INFO - train_pipeline - Base model weights frozen – only classifier head will be trained. | |
| 2026-04-15 12:35:26,856 - INFO - train_pipeline - === Starting training === | |
| 2026-04-15 12:35:23,651 - INFO - train_pipeline - Logging to ./output_checkpoints/codebert-base-cross-entropy/training.log | |
| 2026-04-15 12:35:23,668 - INFO - train_pipeline - Loading model & tokenizer for 'microsoft/codebert-base' | |
| 2026-04-15 12:35:25,145 - INFO - train_pipeline - Model placed on cuda | |
| 2026-04-15 12:35:25,156 - INFO - train_pipeline - ===== Model Architecture ===== | |
| 2026-04-15 12:35:25,169 - INFO - train_pipeline - | |
| RobertaForSequenceClassification( | |
| (roberta): RobertaModel( | |
| (embeddings): RobertaEmbeddings( | |
| (word_embeddings): Embedding(50265, 768, padding_idx=1) | |
| (position_embeddings): Embedding(514, 768, padding_idx=1) | |
| (token_type_embeddings): Embedding(1, 768) | |
| (LayerNorm): LayerNorm((768,), eps=1e-05, elementwise_affine=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| (encoder): RobertaEncoder( | |
| (layer): ModuleList( | |
| (0-11): 12 x RobertaLayer( | |
| (attention): RobertaAttention( | |
| (self): RobertaSdpaSelfAttention( | |
| (query): Linear(in_features=768, out_features=768, bias=True) | |
| (key): Linear(in_features=768, out_features=768, bias=True) | |
| (value): Linear(in_features=768, out_features=768, bias=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| (output): RobertaSelfOutput( | |
| (dense): Linear(in_features=768, out_features=768, bias=True) | |
| (LayerNorm): LayerNorm((768,), eps=1e-05, elementwise_affine=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| ) | |
| (intermediate): RobertaIntermediate( | |
| (dense): Linear(in_features=768, out_features=3072, bias=True) | |
| (intermediate_act_fn): GELUActivation() | |
| ) | |
| (output): RobertaOutput( | |
| (dense): Linear(in_features=3072, out_features=768, bias=True) | |
| (LayerNorm): LayerNorm((768,), eps=1e-05, elementwise_affine=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| ) | |
| ) | |
| ) | |
| ) | |
| (classifier): RobertaClassificationHead( | |
| (dense): Linear(in_features=768, out_features=768, bias=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| (out_proj): Linear(in_features=768, out_features=2, bias=True) | |
| ) | |
| ) | |
| 2026-04-15 12:35:25,191 - INFO - train_pipeline - ===== Tokenizer Summary ===== | |
| 2026-04-15 12:35:25,243 - INFO - train_pipeline - Vocab size: 50265 | Special tokens: ['<s>', '</s>', '<unk>', '<pad>', '<mask>'] | |
| 2026-04-15 12:35:25,254 - INFO - train_pipeline - ===== End of Architecture Log ===== | |
| 2026-04-15 12:35:25,265 - INFO - train_pipeline - Base model weights frozen – only classifier head will be trained. | |
| 2026-04-15 12:35:26,856 - INFO - train_pipeline - === Starting training === | |
| 2026-04-15 12:35:23,651 - INFO - train_pipeline - Logging to ./output_checkpoints/codebert-base-cross-entropy/training.log | |
| 2026-04-15 12:35:23,668 - INFO - train_pipeline - Loading model & tokenizer for 'microsoft/codebert-base' | |
| 2026-04-15 12:35:25,145 - INFO - train_pipeline - Model placed on cuda | |
| 2026-04-15 12:35:25,156 - INFO - train_pipeline - ===== Model Architecture ===== | |
| 2026-04-15 12:35:25,169 - INFO - train_pipeline - | |
| RobertaForSequenceClassification( | |
| (roberta): RobertaModel( | |
| (embeddings): RobertaEmbeddings( | |
| (word_embeddings): Embedding(50265, 768, padding_idx=1) | |
| (position_embeddings): Embedding(514, 768, padding_idx=1) | |
| (token_type_embeddings): Embedding(1, 768) | |
| (LayerNorm): LayerNorm((768,), eps=1e-05, elementwise_affine=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| (encoder): RobertaEncoder( | |
| (layer): ModuleList( | |
| (0-11): 12 x RobertaLayer( | |
| (attention): RobertaAttention( | |
| (self): RobertaSdpaSelfAttention( | |
| (query): Linear(in_features=768, out_features=768, bias=True) | |
| (key): Linear(in_features=768, out_features=768, bias=True) | |
| (value): Linear(in_features=768, out_features=768, bias=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| (output): RobertaSelfOutput( | |
| (dense): Linear(in_features=768, out_features=768, bias=True) | |
| (LayerNorm): LayerNorm((768,), eps=1e-05, elementwise_affine=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| ) | |
| (intermediate): RobertaIntermediate( | |
| (dense): Linear(in_features=768, out_features=3072, bias=True) | |
| (intermediate_act_fn): GELUActivation() | |
| ) | |
| (output): RobertaOutput( | |
| (dense): Linear(in_features=3072, out_features=768, bias=True) | |
| (LayerNorm): LayerNorm((768,), eps=1e-05, elementwise_affine=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| ) | |
| ) | |
| ) | |
| ) | |
| ) | |
| (classifier): RobertaClassificationHead( | |
| (dense): Linear(in_features=768, out_features=768, bias=True) | |
| (dropout): Dropout(p=0.1, inplace=False) | |
| (out_proj): Linear(in_features=768, out_features=2, bias=True) | |
| ) | |
| ) | |
| 2026-04-15 12:35:25,191 - INFO - train_pipeline - ===== Tokenizer Summary ===== | |
| 2026-04-15 12:35:25,243 - INFO - train_pipeline - Vocab size: 50265 | Special tokens: ['<s>', '</s>', '<unk>', '<pad>', '<mask>'] | |
| 2026-04-15 12:35:25,254 - INFO - train_pipeline - ===== End of Architecture Log ===== | |
| 2026-04-15 12:35:25,265 - INFO - train_pipeline - Base model weights frozen – only classifier head will be trained. | |
| 2026-04-15 12:35:26,856 - INFO - train_pipeline - === Starting training === | |