avbiswas commited on
Commit
ab8a507
·
verified ·
1 Parent(s): 06600da

Upload MLX reward tiny model

Browse files
README.md ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ language: en
4
+ library_name: neural-txt
5
+ pipeline_tag: text-classification
6
+ tags:
7
+ - mlx
8
+ - reward-model
9
+ - answer-equivalence
10
+ - question-answering
11
+ base_model: paperbd/neuraltxt-reward-tiny
12
+ ---
13
+
14
+ # NeuralTxt Reward Model MLX
15
+
16
+ MLX-ready package for [`paperbd/neuraltxt-reward-tiny`](https://huggingface.co/paperbd/neuraltxt-reward-tiny).
17
+
18
+ This repo contains:
19
+
20
+ - `model.safetensors`: MiniLM/BERT encoder weights readable by MLX.
21
+ - `reward_head.safetensors`: clamped linear reward head in MLX safetensors format.
22
+ - tokenizer files copied from the source reward model.
23
+
24
+ ## Usage
25
+
26
+ ```python
27
+ from neuraltxt import NeuralTxtReward
28
+
29
+ reward = NeuralTxtReward(backend="mlx")
30
+ score = reward.score(
31
+ response="Paris is the capital of France.",
32
+ reference="The capital of France is Paris.",
33
+ )
34
+ ```
35
+
36
+ To load this repo explicitly:
37
+
38
+ ```python
39
+ reward = NeuralTxtReward("paperbd/neuraltxt-reward-tiny-mlx", backend="mlx")
40
+ ```
config.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_cross_attention": false,
3
+ "architectures": [
4
+ "NeuralTxtRewardMLX"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "bos_token_id": null,
8
+ "classifier_dropout": null,
9
+ "dtype": "float32",
10
+ "eos_token_id": null,
11
+ "gradient_checkpointing": false,
12
+ "hidden_act": "gelu",
13
+ "hidden_dropout_prob": 0.1,
14
+ "hidden_size": 384,
15
+ "initializer_range": 0.02,
16
+ "intermediate_size": 1536,
17
+ "is_decoder": false,
18
+ "layer_norm_eps": 1e-12,
19
+ "max_position_embeddings": 512,
20
+ "model_type": "bert",
21
+ "num_attention_heads": 12,
22
+ "num_hidden_layers": 6,
23
+ "pad_token_id": 0,
24
+ "position_embedding_type": "absolute",
25
+ "tie_word_embeddings": true,
26
+ "transformers_version": "5.5.0",
27
+ "type_vocab_size": 2,
28
+ "use_cache": true,
29
+ "vocab_size": 30522,
30
+ "library_name": "neural-txt",
31
+ "base_model": "paperbd/neuraltxt-reward-tiny",
32
+ "reward_head_file": "reward_head.safetensors",
33
+ "model_file": "model.safetensors",
34
+ "reward_pooling": "meanmax"
35
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3f9156290f370e818ffcc5a3501262fc5e25a1e1e9f3262f64999d5403b8812e
3
+ size 90864176
reward_head.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:95bd2f1b07413f15f59c3d8fae824a6edda5ec67c43df95cde85395dbabe2511
3
+ size 3238
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "cls_token": "[CLS]",
4
+ "do_basic_tokenize": true,
5
+ "do_lower_case": true,
6
+ "is_local": false,
7
+ "mask_token": "[MASK]",
8
+ "max_length": 128,
9
+ "model_max_length": 512,
10
+ "never_split": null,
11
+ "pad_to_multiple_of": null,
12
+ "pad_token": "[PAD]",
13
+ "pad_token_type_id": 0,
14
+ "padding_side": "right",
15
+ "sep_token": "[SEP]",
16
+ "stride": 0,
17
+ "strip_accents": null,
18
+ "tokenize_chinese_chars": true,
19
+ "tokenizer_class": "BertTokenizer",
20
+ "truncation_side": "right",
21
+ "truncation_strategy": "longest_first",
22
+ "unk_token": "[UNK]"
23
+ }