sumitguha13 commited on
Commit
22f841e
·
verified ·
1 Parent(s): ff04c77

Upload slm125MLIVE-sft (fine-tuned)

Browse files
README.md ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: odc-by
3
+ language: [en]
4
+ library_name: transformers
5
+ pipeline_tag: text-generation
6
+ tags: [legal, finance, llama, sft, instruction-tuned]
7
+ ---
8
+
9
+ # slm125MLIVE-sft
10
+
11
+ Instruction fine-tuned (SFT) version of `thesreedath/slm-125m-base` (125M, LLaMA).
12
+ Trained on ~8,000 grounded Q&A pairs (RAFT-style: answer from the provided
13
+ context) synthesized with Gemini 2.5 Flash and grounding-judged.
14
+
15
+ - SFT val perplexity: ~2.71
16
+ - Format: chat with `<|system|> <|user|> <|assistant|>` special tokens.
17
+
18
+ ## Usage
19
+ ```python
20
+ from transformers import AutoModelForCausalLM, AutoTokenizer
21
+ tok = AutoTokenizer.from_pretrained("sumitguha13/slm125MLIVE-sft")
22
+ model = AutoModelForCausalLM.from_pretrained("sumitguha13/slm125MLIVE-sft")
23
+ prompt = ("<|bos|><|system|>\nYou are a helpful assistant. Answer using only the "
24
+ "provided context.\n<|user|>\nContext:\n<PASSAGE>\n\nQuestion: <Q>\n<|assistant|>\n")
25
+ ids = tok(prompt, return_tensors="pt", add_special_tokens=False).input_ids
26
+ print(tok.decode(model.generate(ids, max_new_tokens=120, repetition_penalty=1.3)[0], skip_special_tokens=True))
27
+ ```
28
+
29
+ Small base model: use a context for grounded answers; generations may be imperfect.
config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "/data/ft_base",
3
+ "architectures": [
4
+ "LlamaForCausalLM"
5
+ ],
6
+ "attention_bias": false,
7
+ "attention_dropout": 0.0,
8
+ "bos_token_id": 1,
9
+ "eos_token_id": 2,
10
+ "head_dim": 64,
11
+ "hidden_act": "silu",
12
+ "hidden_size": 768,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 3072,
15
+ "max_position_embeddings": 1024,
16
+ "mlp_bias": false,
17
+ "model_type": "llama",
18
+ "num_attention_heads": 12,
19
+ "num_hidden_layers": 12,
20
+ "num_key_value_heads": 12,
21
+ "pretraining_tp": 1,
22
+ "rms_norm_eps": 1e-05,
23
+ "rope_scaling": null,
24
+ "rope_theta": 10000.0,
25
+ "tie_word_embeddings": true,
26
+ "torch_dtype": "float32",
27
+ "transformers_version": "4.46.3",
28
+ "use_cache": true,
29
+ "vocab_size": 16384
30
+ }
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "eos_token_id": 2,
5
+ "transformers_version": "4.46.3"
6
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fc7f0a2240c36c74207dd6a3fbd3cd02380f3b4b9549a71bba4e58f94dcbfcb3
3
+ size 503405488
special_tokens_map.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|user|>",
4
+ "<|assistant|>",
5
+ "<|system|>"
6
+ ],
7
+ "bos_token": {
8
+ "content": "<|bos|>",
9
+ "lstrip": false,
10
+ "normalized": false,
11
+ "rstrip": false,
12
+ "single_word": false
13
+ },
14
+ "eos_token": {
15
+ "content": "<|eos|>",
16
+ "lstrip": false,
17
+ "normalized": false,
18
+ "rstrip": false,
19
+ "single_word": false
20
+ },
21
+ "pad_token": {
22
+ "content": "<|pad|>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false
27
+ },
28
+ "unk_token": {
29
+ "content": "<|unk|>",
30
+ "lstrip": false,
31
+ "normalized": false,
32
+ "rstrip": false,
33
+ "single_word": false
34
+ }
35
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "<|bos|>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "<|eos|>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "<|pad|>",
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": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "4": {
36
+ "content": "<|user|>",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ },
43
+ "5": {
44
+ "content": "<|assistant|>",
45
+ "lstrip": false,
46
+ "normalized": false,
47
+ "rstrip": false,
48
+ "single_word": false,
49
+ "special": true
50
+ },
51
+ "6": {
52
+ "content": "<|system|>",
53
+ "lstrip": false,
54
+ "normalized": false,
55
+ "rstrip": false,
56
+ "single_word": false,
57
+ "special": true
58
+ }
59
+ },
60
+ "additional_special_tokens": [
61
+ "<|user|>",
62
+ "<|assistant|>",
63
+ "<|system|>"
64
+ ],
65
+ "bos_token": "<|bos|>",
66
+ "clean_up_tokenization_spaces": false,
67
+ "eos_token": "<|eos|>",
68
+ "model_max_length": 1000000000000000019884624838656,
69
+ "pad_token": "<|pad|>",
70
+ "tokenizer_class": "PreTrainedTokenizerFast",
71
+ "unk_token": "<|unk|>"
72
+ }