harshit36 commited on
Commit
3f2c4eb
·
verified ·
1 Parent(s): 46fe12d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +114 -1
README.md CHANGED
@@ -8,4 +8,117 @@ library_name: transformers
8
  tags:
9
  - LLM
10
  - SLM
11
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  tags:
9
  - LLM
10
  - SLM
11
+ - StoryLLM
12
+ - CasualLLM
13
+ - NOVA
14
+ - NOVA-Verse
15
+ ---
16
+ ---
17
+ license: apache-2.0
18
+ language:
19
+ - en
20
+ library_name: transformers
21
+ tags:
22
+ - LLM
23
+ - CasualLLM
24
+ - StoryLLM
25
+ - SLM
26
+ - NOVA
27
+ ---
28
+ # Nova-Casual-LLM
29
+
30
+ A NOVA Finetuned model which is specifically trained for decision-driven Story generator.
31
+
32
+ ## Model Summary
33
+
34
+ - **Model Name**: NovaForCausalLM
35
+ - **Architecture**: Custom decoder-only transformer (`NOVA`)
36
+ - **Model Type**: `nova` (Fine-tuned version)
37
+ - **Use Case**: Causal Language Modeling (text generation, auto-completion)
38
+ - **Parameters**: 14,412,400 trainable parameters
39
+ - **Pretrained Tokenizer**: `PreTrainedTokenizerFast`
40
+ - **Framework**: PyTorch
41
+ - **Hugging Face Integration**: Compatible with `transformers` via custom `AutoModel` and `AutoConfig` registration.
42
+
43
+ ---
44
+
45
+ ## Files Included
46
+
47
+ | File | Description |
48
+ |---------------------------|----------------------------------------------------|
49
+ | `config.json` | Configuration of model hyperparameters |
50
+ | `model.safetensors` | Serialized model weights (efficient format) |
51
+ | `nova_modelling.py` | Custom model and config class definitions |
52
+ | `tokenizer.json` | Serialized tokenizer |
53
+ | `tokenizer_config.json` | Tokenizer configuration metadata |
54
+ | `special_tokens_map.json` | Mapping for special tokens (e.g., BOS, EOS) |
55
+ | `README.md` | Model card (you’re reading it!) |
56
+
57
+ ---
58
+
59
+ ## Model Architecture
60
+
61
+ ### `NovaForCausalLM`
62
+
63
+ The model consists of:
64
+ - Embedding layers: token + positional
65
+ - Stack of transformer decoder blocks
66
+ - Multi-head attention with 640 individual heads
67
+ - Layer normalization
68
+ - Final linear head for vocabulary logits
69
+
70
+ ### Configuration (`NovaConfig`)
71
+
72
+ ```json
73
+ {
74
+ "model_type": "nova",
75
+ "vocab_size": 6000,
76
+ "block_size": 256,
77
+ "n_embd": 640,
78
+ "n_layer": 4,
79
+ "n_head": 8
80
+ }
81
+ ```
82
+
83
+ ## 🚀 Usage
84
+
85
+ ### Step 1: Clone the repo (to get the `nova_modelling.py`)
86
+
87
+ ```bash
88
+ git clone https://huggingface.co/harshit36/Nova-Casual-LLM
89
+ cd Nova-Casual-LLM
90
+ ```
91
+
92
+ ```python
93
+ import sys
94
+ sys.path.append("./Nova-Casual-LLM/") # add current dir to path
95
+
96
+ from transformers import PreTrainedTokenizerFast
97
+ from nova_modelling import NovaConfig, NovaForCausalLM
98
+
99
+ # Load tokenizer
100
+ tokenizer = PreTrainedTokenizerFast.from_pretrained("harshit36/Nova-Casual-LLM")
101
+
102
+ # Load config
103
+ config = NovaConfig.from_pretrained("harshit36/Nova-Casual-LLM")
104
+
105
+ # Instantiate model using your custom class
106
+ model = NovaForCausalLM(config)
107
+ model = model.from_pretrained("harshit36/Nova-Casual-LLM")
108
+
109
+ # Use the model
110
+ input_ids = tokenizer("Hello world", return_tensors="pt").input_ids
111
+ output = model.generate(input_ids)
112
+ print(tokenizer.decode(output[0], skip_special_tokens=True).replace(" ","").replace("Ġ"," ").replace("Ċ","\n"))
113
+
114
+ ```
115
+
116
+ ## Intended Use
117
+
118
+ Story text generation
119
+
120
+ Hybrid Positional Encoding Research model (Combination of Sinusoidal and learnable encodings)
121
+
122
+ Educational demonstrations of custom HF model integration
123
+
124
+ Rapid prototyping of transformer models