srikanthgali commited on
Commit
5afc82a
·
verified ·
1 Parent(s): 3ff4e42

Upload ParaDetect LoRA model

Browse files
README.md CHANGED
@@ -1,3 +1,52 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ # DeBERTa-v3-Large Fine-tuned for AI Text Detection
3
+
4
+ ## Model Description
5
+ This model is a fine-tuned version of microsoft/deberta-v3-large using LoRA (Low-Rank Adaptation)
6
+ for binary classification of human vs AI-generated text.
7
+
8
+ ## Training Details
9
+ - **Base Model**: microsoft/deberta-v3-large
10
+ - **Fine-tuning Method**: LoRA (Low-Rank Adaptation)
11
+ - **Task**: Binary text classification (Human vs AI)
12
+ - **Dataset**: AI Text Detection Pile (cleaned)
13
+ - **Training Epochs**: 1.0
14
+ - **Training Steps**: 4000
15
+ - **Early Stopping**: Patience of 10 steps
16
+
17
+ ## Performance Metrics (Test Set)
18
+ - **Accuracy**: 0.9931
19
+ - **Precision (Weighted)**: 0.9931
20
+ - **Recall (Weighted)**: 0.9931
21
+ - **F1-score (Weighted)**: 0.9931
22
+
23
+ ## Class-wise Performance
24
+ ### Human Text (Class 0)
25
+ - Precision: 0.9972
26
+ - Recall: 0.9889
27
+ - F1-score: 0.9930
28
+
29
+ ### AI Text (Class 1)
30
+ - Precision: 0.9891
31
+ - Recall: 0.9972
32
+ - F1-score: 0.9931
33
+
34
+ ## Usage
35
+ ```python
36
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
37
+ from peft import PeftModel
38
+
39
+ # Load model and tokenizer
40
+ tokenizer = AutoTokenizer.from_pretrained('/content/drive/MyDrive/Colab Notebooks/ParaDetect/models/deberta-v3-large-lora-final')
41
+ base_model = AutoModelForSequenceClassification.from_pretrained('microsoft/deberta-v3-large')
42
+ model = PeftModel.from_pretrained(base_model, '/content/drive/MyDrive/Colab Notebooks/ParaDetect/models/deberta-v3-large-lora-final')
43
+
44
+ # Make predictions
45
+ text = "Your text here"
46
+ inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
47
+ outputs = model(**inputs)
48
+ prediction = torch.nn.functional.softmax(outputs.logits, dim=-1)
49
+ ```
50
+
51
+ ## Training Date
52
+ 2025-10-06 07:31:53
adapter_config.json ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": null,
4
+ "base_model_name_or_path": "microsoft/deberta-v3-large",
5
+ "bias": "all",
6
+ "corda_config": null,
7
+ "eva_config": null,
8
+ "exclude_modules": null,
9
+ "fan_in_fan_out": false,
10
+ "inference_mode": true,
11
+ "init_lora_weights": true,
12
+ "layer_replication": null,
13
+ "layers_pattern": null,
14
+ "layers_to_transform": null,
15
+ "loftq_config": {},
16
+ "lora_alpha": 128,
17
+ "lora_bias": false,
18
+ "lora_dropout": 0.1,
19
+ "megatron_config": null,
20
+ "megatron_core": "megatron.core",
21
+ "modules_to_save": [
22
+ "classifier",
23
+ "score"
24
+ ],
25
+ "peft_type": "LORA",
26
+ "qalora_group_size": 16,
27
+ "r": 64,
28
+ "rank_pattern": {},
29
+ "revision": null,
30
+ "target_modules": [
31
+ "query_proj",
32
+ "value_proj",
33
+ "dense",
34
+ "key_proj",
35
+ "output.dense"
36
+ ],
37
+ "target_parameters": null,
38
+ "task_type": "SEQ_CLS",
39
+ "trainable_token_indices": null,
40
+ "use_dora": false,
41
+ "use_qalora": false,
42
+ "use_rslora": false
43
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:05632189c39031f6a4b330d8852e68058e57d091866060469ec020d27e375a19
3
+ size 114943888
added_tokens.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "[MASK]": 128000
3
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "[CLS]",
3
+ "cls_token": "[CLS]",
4
+ "eos_token": "[SEP]",
5
+ "mask_token": "[MASK]",
6
+ "pad_token": "[PAD]",
7
+ "sep_token": "[SEP]",
8
+ "unk_token": {
9
+ "content": "[UNK]",
10
+ "lstrip": false,
11
+ "normalized": true,
12
+ "rstrip": false,
13
+ "single_word": false
14
+ }
15
+ }
spm.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c679fbf93643d19aab7ee10c0b99e460bdbc02fedf34b92b05af343b4af586fd
3
+ size 2464616
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "[CLS]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "[SEP]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "[UNK]",
29
+ "lstrip": false,
30
+ "normalized": true,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "128000": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "bos_token": "[CLS]",
45
+ "clean_up_tokenization_spaces": false,
46
+ "cls_token": "[CLS]",
47
+ "do_lower_case": false,
48
+ "eos_token": "[SEP]",
49
+ "extra_special_tokens": {},
50
+ "mask_token": "[MASK]",
51
+ "model_max_length": 1000000000000000019884624838656,
52
+ "pad_token": "[PAD]",
53
+ "sep_token": "[SEP]",
54
+ "sp_model_kwargs": {},
55
+ "split_by_punct": false,
56
+ "tokenizer_class": "DebertaV2Tokenizer",
57
+ "unk_token": "[UNK]",
58
+ "vocab_type": "spm"
59
+ }