Instructions to use azherali/CodeDetect-BERT-T2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use azherali/CodeDetect-BERT-T2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="azherali/CodeDetect-BERT-T2")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("azherali/CodeDetect-BERT-T2") model = AutoModelForSequenceClassification.from_pretrained("azherali/CodeDetect-BERT-T2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| library_name: transformers | |
| license: apache-2.0 | |
| base_model: bert-base-uncased | |
| tags: | |
| - generated_from_trainer | |
| metrics: | |
| - accuracy | |
| - f1 | |
| - precision | |
| - recall | |
| model-index: | |
| - name: CodeDetect-BERT-T2 | |
| results: [] | |
| <!-- This model card has been generated automatically according to the information the Trainer had access to. You | |
| should probably proofread and complete it, then remove this comment. --> | |
| # CodeDetect-BERT-T2 | |
| This model is a fine-tuned version of [bert-base-uncased](https://huggingface.co/bert-base-uncased) on the None dataset. | |
| It achieves the following results on the evaluation set: | |
| - Loss: 2.2616 | |
| - Accuracy: 0.9178 | |
| - F1: 0.4680 | |
| - Precision: 0.4960 | |
| - Recall: 0.4600 | |
| ## Model description | |
| More information needed | |
| ## Intended uses & limitations | |
| More information needed | |
| ## Training and evaluation data | |
| More information needed | |
| ## Training procedure | |
| ### Training hyperparameters | |
| The following hyperparameters were used during training: | |
| - learning_rate: 2e-05 | |
| - train_batch_size: 128 | |
| - eval_batch_size: 128 | |
| - seed: 42 | |
| - optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments | |
| - lr_scheduler_type: linear | |
| - lr_scheduler_warmup_steps: 500 | |
| - num_epochs: 5 | |
| - mixed_precision_training: Native AMP | |
| ### Training results | |
| | Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 | Precision | Recall | | |
| |:-------------:|:------:|:-----:|:---------------:|:--------:|:------:|:---------:|:------:| | |
| | 2.1731 | 1.2798 | 5000 | 2.2130 | 0.9197 | 0.3964 | 0.4880 | 0.3890 | | |
| | 1.8504 | 2.5595 | 10000 | 2.1255 | 0.9216 | 0.4423 | 0.5119 | 0.4239 | | |
| | 1.5734 | 3.8393 | 15000 | 2.1121 | 0.9226 | 0.4766 | 0.5175 | 0.4584 | | |
| | 1.4124 | 5.0 | 19535 | 2.2616 | 0.9178 | 0.4680 | 0.4960 | 0.4600 | | |
| ### Framework versions | |
| - Transformers 5.13.1 | |
| - Pytorch 2.11.0+cu128 | |
| - Datasets 4.0.0 | |
| - Tokenizers 0.22.2 | |