DrJohnCode commited on
Commit
e8c410c
·
verified ·
1 Parent(s): b908458

Upload 7 files

Browse files
Files changed (7) hide show
  1. LICENSE +21 -0
  2. README.md +62 -0
  3. config.json +10 -0
  4. corpus.txt +20 -0
  5. generate.py +38 -0
  6. train.py +34 -0
  7. transitions.json +405 -0
LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2026 NebulaText Demo Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
README.md CHANGED
@@ -1,3 +1,65 @@
1
  ---
 
 
2
  license: mit
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - en
4
  license: mit
5
+ tags:
6
+ - synthetic
7
+ - demo
8
+ - text-generation
9
+ - educational
10
+ pipeline_tag: text-generation
11
  ---
12
+
13
+ # NebulaText-125M-Demo
14
+
15
+ **A fictional model concept with an executable toy text generator.** The name “125M” is purely branding: this repository **does not contain a 125-million-parameter model**, pretrained weights, or benchmark results.
16
+
17
+ ## Overview
18
+
19
+ NebulaText is a speculative concept for a lightweight language model with a fictional *Orbit Memory Routing* architecture. This repository provides a small, working word-level Markov-chain demonstration trained on a short synthetic example corpus. It is meant for Hugging Face repository setup and experimentation—not production inference.
20
+
21
+ ### Concept (not implemented)
22
+
23
+ - Orbit Memory Routing (OMR): fictional recurrent context router
24
+ - Adaptive Token Folding (ATF): fictional compute optimization
25
+ - Hypothetical architecture only; no empirical performance claims
26
+
27
+ ## Run the included demo
28
+
29
+ Python 3.9+; no third-party dependencies:
30
+
31
+ ```bash
32
+ python generate.py --prompt "The future of AI" --max-new-words 35 --seed 7
33
+ ```
34
+
35
+ You can also train the tiny word-transition model on your own plaintext corpus:
36
+
37
+ ```bash
38
+ python train.py --input corpus.txt --output transitions.json
39
+ python generate.py --model transitions.json --prompt "AI systems" --max-new-words 30
40
+ ```
41
+
42
+ The included `transitions.json` is a count table, **not neural weights**. Outputs may be repetitive or nonsensical and shouldn't be treated as facts.
43
+
44
+ ## Model details
45
+
46
+ | Field | Value |
47
+ |---|---|
48
+ | Model type | Toy word-level Markov generator |
49
+ | Neural parameter count | N/A |
50
+ | Training source | Included synthetic demonstration corpus |
51
+ | Intended use | Software demos, tutorials, repository experiments |
52
+ | Not intended for | Production generation, factual QA, medical or financial decisions |
53
+
54
+ ## Limitations and ethics
55
+
56
+ This is a deterministic seeded sampling demo, not an LLM. It has no verified safety, accuracy, or robustness properties. Any future experimental research results should be independently measured before publication. Not affiliated with NVIDIA, Hugging Face, or any AI laboratory.
57
+
58
+ ## Repository layout
59
+
60
+ - `generate.py`: sample text using a small transition table
61
+ - `train.py`: build transitions from a local text file
62
+ - `transitions.json`: synthetic corpus transition counts
63
+ - `corpus.txt`: example source sentences
64
+ - `config.json`: demo metadata
65
+ - `LICENSE`: MIT
config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "NebulaText-125M-Demo",
3
+ "model_type": "word_markov_toy",
4
+ "architecture_concept": "Orbit Memory Routing (fictional, not implemented)",
5
+ "neural_parameters": null,
6
+ "is_pretrained": false,
7
+ "is_synthetic_demo": true,
8
+ "language": "en",
9
+ "version": "0.1.0"
10
+ }
corpus.txt ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The future of AI depends on careful research and clear evaluation.
2
+ The future of AI includes efficient models and responsible deployment.
3
+ AI systems can help people explore creative ideas.
4
+ AI systems can process text and summarize simple patterns.
5
+ Small models are useful for quick experiments.
6
+ Small models can demonstrate the basics of text generation.
7
+ Researchers explore memory routing in hypothetical architectures.
8
+ Researchers test ideas with transparent baselines.
9
+ A synthetic dataset is not a substitute for real evaluation.
10
+ A model card should explain training data and limitations.
11
+ GPU acceleration can support large neural networks.
12
+ Efficient inference requires careful measurement.
13
+ NebulaText is a fictional research concept.
14
+ This repository contains a small educational demo.
15
+ Reproducible experiments help separate concepts from results.
16
+ Language modeling can be introduced with word transitions.
17
+ A Markov chain predicts the next word from the previous state.
18
+ The demonstration samples from a table of observed transitions.
19
+ An experimental prototype should not claim unmeasured performance.
20
+ Transparent documentation makes software easier to evaluate.
generate.py ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Sample from a toy word-level Markov model. No pretrained LLM is included."""
2
+ import argparse
3
+ import json
4
+ import random
5
+ import re
6
+ from pathlib import Path
7
+
8
+
9
+ def sample(model, prompt, max_new_words, seed):
10
+ rng = random.Random(seed)
11
+ tokens = re.findall(r"[A-Za-z0-9']+|[.,!?;:]", prompt)
12
+ state = tokens[-1] if tokens else '<START>'
13
+ output = list(tokens)
14
+ for _ in range(max_new_words):
15
+ options = model.get(state) or model.get('<START>', {})
16
+ if not options:
17
+ break
18
+ candidates, weights = zip(*options.items())
19
+ word = rng.choices(candidates, weights=weights, k=1)[0]
20
+ if word == '<END>':
21
+ break
22
+ output.append(word)
23
+ state = word
24
+ text = ' '.join(output)
25
+ return re.sub(r'\s+([.,!?;:])', r'\1', text)
26
+
27
+
28
+ if __name__ == '__main__':
29
+ p = argparse.ArgumentParser()
30
+ p.add_argument('--model', default='transitions.json')
31
+ p.add_argument('--prompt', default='The future of AI')
32
+ p.add_argument('--max-new-words', type=int, default=35)
33
+ p.add_argument('--seed', type=int, default=7)
34
+ a = p.parse_args()
35
+ if a.max_new_words < 0:
36
+ p.error('--max-new-words must be >= 0')
37
+ model = json.loads(Path(a.model).read_text(encoding='utf-8'))
38
+ print(sample(model, a.prompt, a.max_new_words, a.seed))
train.py ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Train a tiny word-level transition table. Not a neural network."""
2
+ import argparse
3
+ import json
4
+ import re
5
+ from collections import Counter, defaultdict
6
+ from pathlib import Path
7
+
8
+
9
+ def tokenize(text):
10
+ return re.findall(r"[A-Za-z0-9']+|[.,!?;:]", text)
11
+
12
+
13
+ def train(text):
14
+ counts = defaultdict(Counter)
15
+ for line in text.splitlines():
16
+ words = tokenize(line.strip())
17
+ if not words:
18
+ continue
19
+ prior = '<START>'
20
+ for word in words:
21
+ counts[prior][word] += 1
22
+ prior = word
23
+ counts[prior]['<END>'] += 1
24
+ return {word: dict(next_words) for word, next_words in sorted(counts.items())}
25
+
26
+
27
+ if __name__ == '__main__':
28
+ p = argparse.ArgumentParser()
29
+ p.add_argument('--input', default='corpus.txt')
30
+ p.add_argument('--output', default='transitions.json')
31
+ args = p.parse_args()
32
+ model = train(Path(args.input).read_text(encoding='utf-8'))
33
+ Path(args.output).write_text(json.dumps(model, indent=2, ensure_ascii=False) + '\n', encoding='utf-8')
34
+ print(f'Wrote {len(model)} transition states to {args.output}')
transitions.json ADDED
@@ -0,0 +1,405 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ ".": {
3
+ "<END>": 20
4
+ },
5
+ "<START>": {
6
+ "The": 3,
7
+ "AI": 2,
8
+ "Small": 2,
9
+ "Researchers": 2,
10
+ "A": 3,
11
+ "GPU": 1,
12
+ "Efficient": 1,
13
+ "NebulaText": 1,
14
+ "This": 1,
15
+ "Reproducible": 1,
16
+ "Language": 1,
17
+ "An": 1,
18
+ "Transparent": 1
19
+ },
20
+ "A": {
21
+ "synthetic": 1,
22
+ "model": 1,
23
+ "Markov": 1
24
+ },
25
+ "AI": {
26
+ "depends": 1,
27
+ "includes": 1,
28
+ "systems": 2
29
+ },
30
+ "An": {
31
+ "experimental": 1
32
+ },
33
+ "Efficient": {
34
+ "inference": 1
35
+ },
36
+ "GPU": {
37
+ "acceleration": 1
38
+ },
39
+ "Language": {
40
+ "modeling": 1
41
+ },
42
+ "Markov": {
43
+ "chain": 1
44
+ },
45
+ "NebulaText": {
46
+ "is": 1
47
+ },
48
+ "Reproducible": {
49
+ "experiments": 1
50
+ },
51
+ "Researchers": {
52
+ "explore": 1,
53
+ "test": 1
54
+ },
55
+ "Small": {
56
+ "models": 2
57
+ },
58
+ "The": {
59
+ "future": 2,
60
+ "demonstration": 1
61
+ },
62
+ "This": {
63
+ "repository": 1
64
+ },
65
+ "Transparent": {
66
+ "documentation": 1
67
+ },
68
+ "a": {
69
+ "substitute": 1,
70
+ "fictional": 1,
71
+ "small": 1,
72
+ "table": 1
73
+ },
74
+ "acceleration": {
75
+ "can": 1
76
+ },
77
+ "and": {
78
+ "clear": 1,
79
+ "responsible": 1,
80
+ "summarize": 1,
81
+ "limitations": 1
82
+ },
83
+ "architectures": {
84
+ ".": 1
85
+ },
86
+ "are": {
87
+ "useful": 1
88
+ },
89
+ "baselines": {
90
+ ".": 1
91
+ },
92
+ "basics": {
93
+ "of": 1
94
+ },
95
+ "be": {
96
+ "introduced": 1
97
+ },
98
+ "can": {
99
+ "help": 1,
100
+ "process": 1,
101
+ "demonstrate": 1,
102
+ "support": 1,
103
+ "be": 1
104
+ },
105
+ "card": {
106
+ "should": 1
107
+ },
108
+ "careful": {
109
+ "research": 1,
110
+ "measurement": 1
111
+ },
112
+ "chain": {
113
+ "predicts": 1
114
+ },
115
+ "claim": {
116
+ "unmeasured": 1
117
+ },
118
+ "clear": {
119
+ "evaluation": 1
120
+ },
121
+ "concept": {
122
+ ".": 1
123
+ },
124
+ "concepts": {
125
+ "from": 1
126
+ },
127
+ "contains": {
128
+ "a": 1
129
+ },
130
+ "creative": {
131
+ "ideas": 1
132
+ },
133
+ "data": {
134
+ "and": 1
135
+ },
136
+ "dataset": {
137
+ "is": 1
138
+ },
139
+ "demo": {
140
+ ".": 1
141
+ },
142
+ "demonstrate": {
143
+ "the": 1
144
+ },
145
+ "demonstration": {
146
+ "samples": 1
147
+ },
148
+ "depends": {
149
+ "on": 1
150
+ },
151
+ "deployment": {
152
+ ".": 1
153
+ },
154
+ "documentation": {
155
+ "makes": 1
156
+ },
157
+ "easier": {
158
+ "to": 1
159
+ },
160
+ "educational": {
161
+ "demo": 1
162
+ },
163
+ "efficient": {
164
+ "models": 1
165
+ },
166
+ "evaluate": {
167
+ ".": 1
168
+ },
169
+ "evaluation": {
170
+ ".": 2
171
+ },
172
+ "experimental": {
173
+ "prototype": 1
174
+ },
175
+ "experiments": {
176
+ ".": 1,
177
+ "help": 1
178
+ },
179
+ "explain": {
180
+ "training": 1
181
+ },
182
+ "explore": {
183
+ "creative": 1,
184
+ "memory": 1
185
+ },
186
+ "fictional": {
187
+ "research": 1
188
+ },
189
+ "for": {
190
+ "quick": 1,
191
+ "real": 1
192
+ },
193
+ "from": {
194
+ "results": 1,
195
+ "the": 1,
196
+ "a": 1
197
+ },
198
+ "future": {
199
+ "of": 2
200
+ },
201
+ "generation": {
202
+ ".": 1
203
+ },
204
+ "help": {
205
+ "people": 1,
206
+ "separate": 1
207
+ },
208
+ "hypothetical": {
209
+ "architectures": 1
210
+ },
211
+ "ideas": {
212
+ ".": 1,
213
+ "with": 1
214
+ },
215
+ "in": {
216
+ "hypothetical": 1
217
+ },
218
+ "includes": {
219
+ "efficient": 1
220
+ },
221
+ "inference": {
222
+ "requires": 1
223
+ },
224
+ "introduced": {
225
+ "with": 1
226
+ },
227
+ "is": {
228
+ "not": 1,
229
+ "a": 1
230
+ },
231
+ "large": {
232
+ "neural": 1
233
+ },
234
+ "limitations": {
235
+ ".": 1
236
+ },
237
+ "makes": {
238
+ "software": 1
239
+ },
240
+ "measurement": {
241
+ ".": 1
242
+ },
243
+ "memory": {
244
+ "routing": 1
245
+ },
246
+ "model": {
247
+ "card": 1
248
+ },
249
+ "modeling": {
250
+ "can": 1
251
+ },
252
+ "models": {
253
+ "and": 1,
254
+ "are": 1,
255
+ "can": 1
256
+ },
257
+ "networks": {
258
+ ".": 1
259
+ },
260
+ "neural": {
261
+ "networks": 1
262
+ },
263
+ "next": {
264
+ "word": 1
265
+ },
266
+ "not": {
267
+ "a": 1,
268
+ "claim": 1
269
+ },
270
+ "observed": {
271
+ "transitions": 1
272
+ },
273
+ "of": {
274
+ "AI": 2,
275
+ "text": 1,
276
+ "observed": 1
277
+ },
278
+ "on": {
279
+ "careful": 1
280
+ },
281
+ "patterns": {
282
+ ".": 1
283
+ },
284
+ "people": {
285
+ "explore": 1
286
+ },
287
+ "performance": {
288
+ ".": 1
289
+ },
290
+ "predicts": {
291
+ "the": 1
292
+ },
293
+ "previous": {
294
+ "state": 1
295
+ },
296
+ "process": {
297
+ "text": 1
298
+ },
299
+ "prototype": {
300
+ "should": 1
301
+ },
302
+ "quick": {
303
+ "experiments": 1
304
+ },
305
+ "real": {
306
+ "evaluation": 1
307
+ },
308
+ "repository": {
309
+ "contains": 1
310
+ },
311
+ "requires": {
312
+ "careful": 1
313
+ },
314
+ "research": {
315
+ "and": 1,
316
+ "concept": 1
317
+ },
318
+ "responsible": {
319
+ "deployment": 1
320
+ },
321
+ "results": {
322
+ ".": 1
323
+ },
324
+ "routing": {
325
+ "in": 1
326
+ },
327
+ "samples": {
328
+ "from": 1
329
+ },
330
+ "separate": {
331
+ "concepts": 1
332
+ },
333
+ "should": {
334
+ "explain": 1,
335
+ "not": 1
336
+ },
337
+ "simple": {
338
+ "patterns": 1
339
+ },
340
+ "small": {
341
+ "educational": 1
342
+ },
343
+ "software": {
344
+ "easier": 1
345
+ },
346
+ "state": {
347
+ ".": 1
348
+ },
349
+ "substitute": {
350
+ "for": 1
351
+ },
352
+ "summarize": {
353
+ "simple": 1
354
+ },
355
+ "support": {
356
+ "large": 1
357
+ },
358
+ "synthetic": {
359
+ "dataset": 1
360
+ },
361
+ "systems": {
362
+ "can": 2
363
+ },
364
+ "table": {
365
+ "of": 1
366
+ },
367
+ "test": {
368
+ "ideas": 1
369
+ },
370
+ "text": {
371
+ "and": 1,
372
+ "generation": 1
373
+ },
374
+ "the": {
375
+ "basics": 1,
376
+ "next": 1,
377
+ "previous": 1
378
+ },
379
+ "to": {
380
+ "evaluate": 1
381
+ },
382
+ "training": {
383
+ "data": 1
384
+ },
385
+ "transitions": {
386
+ ".": 2
387
+ },
388
+ "transparent": {
389
+ "baselines": 1
390
+ },
391
+ "unmeasured": {
392
+ "performance": 1
393
+ },
394
+ "useful": {
395
+ "for": 1
396
+ },
397
+ "with": {
398
+ "transparent": 1,
399
+ "word": 1
400
+ },
401
+ "word": {
402
+ "transitions": 1,
403
+ "from": 1
404
+ }
405
+ }