pandayhim commited on
Commit
dbd8a1d
·
verified ·
1 Parent(s): 084be20

Upload 6 files

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,3 +1,50 @@
 
 
 
 
 
1
  ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: apache-2.0
5
+ library_name: transformers
6
  ---
7
+
8
+ # English Text Classifier
9
+
10
+ This repository contains a runnable sequence-classification model for English text.
11
+
12
+ ## Files Needed for Inference
13
+
14
+ - `config.json`
15
+ - `model.safetensors`
16
+ - `tokenizer.json`
17
+ - `tokenizer_config.json`
18
+ - `special_tokens_map.json`
19
+
20
+ ## Minimal Usage
21
+
22
+ ```python
23
+ import torch
24
+ from transformers import AutoModelForSequenceClassification, AutoTokenizer
25
+
26
+ model_path = "."
27
+ tokenizer = AutoTokenizer.from_pretrained(model_path)
28
+ model = AutoModelForSequenceClassification.from_pretrained(model_path)
29
+ model.eval()
30
+
31
+ texts = [
32
+ "I disagree with this argument, but the evidence is interesting.",
33
+ "You are awful and should leave.",
34
+ ]
35
+
36
+ inputs = tokenizer(
37
+ texts,
38
+ padding=True,
39
+ truncation=True,
40
+ return_tensors="pt",
41
+ )
42
+
43
+ with torch.no_grad():
44
+ logits = model(**inputs).logits
45
+ scores = torch.sigmoid(logits)
46
+
47
+ print(scores.tolist())
48
+ ```
49
+
50
+ The model returns a 14-dimensional score vector for each input text.
config.json ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "attention_bias": false,
3
+ "attention_dropout": 0.0,
4
+ "bos_token_id": 2,
5
+ "classifier_activation": "gelu",
6
+ "classifier_bias": false,
7
+ "classifier_dropout": 0.0,
8
+ "classifier_pooling": "mean",
9
+ "cls_token_id": 1,
10
+ "decoder_bias": true,
11
+ "deterministic_flash_attn": false,
12
+ "dtype": "float32",
13
+ "embedding_dropout": 0.0,
14
+ "eos_token_id": 1,
15
+ "global_attn_every_n_layers": 3,
16
+ "global_rope_theta": 160000,
17
+ "gradient_checkpointing": false,
18
+ "hidden_activation": "gelu",
19
+ "hidden_size": 384,
20
+ "initializer_cutoff_factor": 2.0,
21
+ "initializer_range": 0.02,
22
+ "intermediate_size": 1152,
23
+ "layer_norm_eps": 1E-05,
24
+ "local_attention": 128,
25
+ "local_rope_theta": 160000,
26
+ "mask_token_id": 4,
27
+ "max_position_embeddings": 8192,
28
+ "mlp_bias": false,
29
+ "mlp_dropout": 0.0,
30
+ "model_type": "modernbert",
31
+ "norm_bias": false,
32
+ "norm_eps": 1E-05,
33
+ "num_attention_heads": 6,
34
+ "num_hidden_layers": 22,
35
+ "pad_token_id": 0,
36
+ "position_embedding_type": "sans_pos",
37
+ "repad_logits_with_grad": false,
38
+ "sep_token_id": 1,
39
+ "sparse_pred_ignore_index": -100,
40
+ "sparse_prediction": false,
41
+ "vocab_size": 256000,
42
+ "num_labels": 14
43
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:99e6e5b55c0d8e38b4d08f2aae2b8d9047641635010a38385facc8fc3631bc43
3
+ size 562601880
special_tokens_map.json ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<start_of_turn>",
4
+ "<end_of_turn>"
5
+ ],
6
+ "bos_token": {
7
+ "content": "<bos>",
8
+ "lstrip": false,
9
+ "normalized": false,
10
+ "rstrip": false,
11
+ "single_word": false
12
+ },
13
+ "cls_token": {
14
+ "content": "<bos>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false
19
+ },
20
+ "eos_token": {
21
+ "content": "<eos>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false
26
+ },
27
+ "mask_token": {
28
+ "content": "<mask>",
29
+ "lstrip": true,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false
33
+ },
34
+ "pad_token": {
35
+ "content": "<pad>",
36
+ "lstrip": false,
37
+ "normalized": false,
38
+ "rstrip": false,
39
+ "single_word": false
40
+ },
41
+ "sep_token": {
42
+ "content": "<eos>",
43
+ "lstrip": false,
44
+ "normalized": false,
45
+ "rstrip": false,
46
+ "single_word": false
47
+ },
48
+ "unk_token": {
49
+ "content": "<unk>",
50
+ "lstrip": false,
51
+ "normalized": false,
52
+ "rstrip": false,
53
+ "single_word": false
54
+ }
55
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:609d8f4c067cd3950f88594c5a802616cea245823836ef5848ee4fc40aab5b6f
3
+ size 34363188
tokenizer_config.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "bos_token": "<bos>",
4
+ "clean_up_tokenization_spaces": false,
5
+ "cls_token": "<bos>",
6
+ "eos_token": "<eos>",
7
+ "mask_token": "<mask>",
8
+ "model_input_names": [
9
+ "input_ids",
10
+ "attention_mask"
11
+ ],
12
+ "model_max_length": 8192,
13
+ "pad_token": "<pad>",
14
+ "padding_side": "right",
15
+ "sep_token": "<eos>",
16
+ "spaces_between_special_tokens": false,
17
+ "tokenizer_class": "PreTrainedTokenizerFast",
18
+ "unk_token": "<unk>"
19
+ }