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
File size: 9,127 Bytes
4d2bc22 8cafee4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | 2026-04-16 09:16:18,911 - INFO - Loading model and tokenizer from: ./checkpoints/graphcodebert-robust/checkpoint-200
2026-04-16 09:16:20,848 - INFO - ===== Model Architecture =====
2026-04-16 09:16:20,851 - INFO -
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.2, 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.2, 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.2, 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.2, inplace=False)
)
)
)
)
)
(classifier): RobertaClassificationHead(
(dense): Linear(in_features=768, out_features=768, bias=True)
(dropout): Dropout(p=0.2, inplace=False)
(out_proj): Linear(in_features=768, out_features=2, bias=True)
)
)
2026-04-16 09:16:20,853 - INFO - ===== Parameter Summary =====
2026-04-16 09:16:20,855 - INFO - Total Parameters: 124,647,170
2026-04-16 09:16:20,857 - INFO - Trainable Parameters: 124,647,170
2026-04-16 09:16:20,858 - INFO - Non-trainable Parameters: 0
2026-04-16 09:16:20,859 - INFO - ===== Tokenizer Summary =====
2026-04-16 09:16:20,874 - INFO - Vocab size: 50265 | Special tokens: ['<s>', '</s>', '<unk>', '<pad>', '<mask>']
2026-04-16 09:16:20,876 - INFO - ===== End of Architecture Log =====
2026-04-16 09:16:21,287 - INFO - Loading dataset: DaniilOr/SemEval-2026-Task13 (A)
2026-04-16 09:16:28,538 - INFO - Tokenizing dataset...
2026-04-16 09:16:29,324 - INFO - Running inference on 1000 examples...
2026-04-16 09:16:55,877 - INFO - Calculating classification metrics...
2026-04-16 09:16:55,902 - INFO - ------------------------------
2026-04-16 09:16:55,904 - INFO - METRICS FOR SPLIT: test
2026-04-16 09:16:55,905 - INFO - Accuracy: 0.5030
2026-04-16 09:16:55,907 - INFO - Precision: 0.6228
2026-04-16 09:16:55,909 - INFO - Recall: 0.5030
2026-04-16 09:16:55,910 - INFO - F1-Score: 0.5438
2026-04-16 09:16:55,912 - INFO - ------------------------------
2026-04-16 09:16:55,918 - INFO - Confusion Matrix:
[[422 355]
[142 81]]
2026-04-16 09:16:55,921 - INFO - ✅ Predictions saved to test/inference/graphcodebert-robust/submission.csv
2026-04-16 10:06:49,138 - INFO - Loading model and tokenizer from: ./output_checkpoints/graphcodebert-robust/checkpoint-1000
2026-04-16 10:06:49,327 - INFO - ===== Model Architecture =====
2026-04-16 10:06:49,331 - INFO -
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.2, 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.2, 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.2, 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.2, inplace=False)
)
)
)
)
)
(classifier): RobertaClassificationHead(
(dense): Linear(in_features=768, out_features=768, bias=True)
(dropout): Dropout(p=0.2, inplace=False)
(out_proj): Linear(in_features=768, out_features=2, bias=True)
)
)
2026-04-16 10:06:49,337 - INFO - ===== Parameter Summary =====
2026-04-16 10:06:49,340 - INFO - Total Parameters: 124,647,170
2026-04-16 10:06:49,343 - INFO - Trainable Parameters: 124,647,170
2026-04-16 10:06:49,346 - INFO - Non-trainable Parameters: 0
2026-04-16 10:06:49,349 - INFO - ===== Tokenizer Summary =====
2026-04-16 10:06:49,366 - INFO - Vocab size: 50265 | Special tokens: ['<s>', '</s>', '<unk>', '<pad>', '<mask>']
2026-04-16 10:06:49,369 - INFO - ===== End of Architecture Log =====
2026-04-16 10:06:49,539 - INFO - Loading dataset: dzungpham/SemEval-2026-TaskA-dataset (default)
2026-04-16 10:08:44,659 - INFO - Loading model and tokenizer from: ./output_checkpoints/graphcodebert-robust/checkpoint-1000
2026-04-16 10:08:44,856 - INFO - ===== Model Architecture =====
2026-04-16 10:08:44,861 - INFO -
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.2, 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.2, 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.2, 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.2, inplace=False)
)
)
)
)
)
(classifier): RobertaClassificationHead(
(dense): Linear(in_features=768, out_features=768, bias=True)
(dropout): Dropout(p=0.2, inplace=False)
(out_proj): Linear(in_features=768, out_features=2, bias=True)
)
)
2026-04-16 10:08:44,865 - INFO - ===== Parameter Summary =====
2026-04-16 10:08:44,867 - INFO - Total Parameters: 124,647,170
2026-04-16 10:08:44,870 - INFO - Trainable Parameters: 124,647,170
2026-04-16 10:08:44,874 - INFO - Non-trainable Parameters: 0
2026-04-16 10:08:44,876 - INFO - ===== Tokenizer Summary =====
2026-04-16 10:08:44,893 - INFO - Vocab size: 50265 | Special tokens: ['<s>', '</s>', '<unk>', '<pad>', '<mask>']
2026-04-16 10:08:44,896 - INFO - ===== End of Architecture Log =====
2026-04-16 10:08:45,082 - INFO - Loading dataset: dzungpham/SemEval-2026-TaskA-dataset (default)
2026-04-16 10:08:51,304 - WARNING - Default loading failed due to schema mismatch: An error occurred while generating the dataset
2026-04-16 10:08:51,307 - INFO - Attempting to load split 'test' using data_files...
2026-04-16 10:08:55,114 - INFO - Tokenizing dataset...
2026-04-16 10:14:03,634 - INFO - Running inference on 500000 examples...
|