rafacamargo commited on
Commit
e663138
·
1 Parent(s): c0d2c2b

chore: add model and gradio app

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
+ src/model/*.pt filter=lfs diff=lfs merge=lfs -text
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from prediction import main
3
+
4
+ def infer(word1, word2, word3):
5
+ inputs = [word1, word2, word3]
6
+ result = main(inputs)
7
+ return result
8
+
9
+ demo = gr.Interface(
10
+ fn=infer,
11
+ inputs=[
12
+ gr.Textbox(label="carro"),
13
+ gr.Textbox(label="asadelta"),
14
+ gr.Textbox(label="assoviar"),
15
+ ],
16
+ outputs=gr.Textbox(label="Generated Word + Definition"),
17
+ title="Rellow: Imaginary Word Generator",
18
+ description="Enter three words — the model invents a new word and its definition."
19
+ )
20
+
21
+ demo.launch()
constants/__init__.py ADDED
File without changes
prediction.py ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ import tiktoken
3
+ from constants.tokens import special_tokens
4
+ from services.model import load_model, get_device
5
+
6
+ # Initialize tokenizer
7
+ _tokenizer = tiktoken.get_encoding("cl100k_base")
8
+
9
+ # Generate an imaginary word and its definition from three input words.
10
+ def generate_word(words, model, vocab, inv_vocab, max_length=64):
11
+ device = get_device()
12
+
13
+ # Tokenize input words
14
+ input_text = ",".join(words)
15
+ input_tokens = _tokenizer.encode(input_text)
16
+ input_tensor = torch.tensor([vocab.get(str(tok), vocab["<pad>"]) for tok in input_tokens]).unsqueeze(0).to(device)
17
+
18
+ # Initialize target with SOS token
19
+ target = torch.tensor([[vocab["<sos>"]]]).to(device)
20
+
21
+ # Generate output
22
+ with torch.no_grad():
23
+ for _ in range(max_length):
24
+ output = model(input_tensor, target)
25
+ next_token = output[:, -1, :].argmax(dim=-1, keepdim=True)
26
+
27
+ # Stop if we predict EOS token
28
+ if next_token.item() == vocab["<eos>"]:
29
+ break
30
+
31
+ target = torch.cat([target, next_token], dim=1)
32
+
33
+ # Convert output tokens to text
34
+ output_tokens = target[0].cpu().numpy()
35
+ output_text = _tokenizer.decode([int(inv_vocab[tok]) for tok in output_tokens if tok not in special_tokens.values()])
36
+
37
+ return output_text
38
+
39
+ def main(words=None):
40
+ # Load model and vocabulary
41
+ model, vocab, inv_vocab = load_model()
42
+
43
+ # Use provided words or default example
44
+ if words is None:
45
+ words = ["muito", "grande", "imenso"]
46
+
47
+ result = generate_word(words, model, vocab, inv_vocab)
48
+ print(f"Input words: {', '.join(words)}")
49
+ print(f"Generated: {result}")
50
+ return result
51
+
52
+ if __name__ == "__main__":
53
+ main()
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ torch
2
+ gradio
3
+ tiktoken==0.7.0
4
+ numpy
services/__init__.py ADDED
File without changes
src/constants/tokens.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ special_tokens = {
2
+ '<pad>': 0,
3
+ '<sos>': 1,
4
+ '<eos>': 2,
5
+ }
6
+
7
+ PAD_ID = special_tokens["<pad>"]
8
+ SOS_ID = special_tokens["<sos>"]
9
+ EOS_ID = special_tokens["<eos>"]
src/data/vocab.json ADDED
@@ -0,0 +1,1531 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 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 "67": 9,
9
+ "68": 10,
10
+ "69": 11,
11
+ "70": 12,
12
+ "71": 13,
13
+ "72": 14,
14
+ "73": 15,
15
+ "75": 16,
16
+ "76": 17,
17
+ "77": 18,
18
+ "78": 19,
19
+ "79": 20,
20
+ "81": 21,
21
+ "82": 22,
22
+ "83": 23,
23
+ "84": 24,
24
+ "85": 25,
25
+ "87": 26,
26
+ "89": 27,
27
+ "258": 28,
28
+ "259": 29,
29
+ "263": 30,
30
+ "264": 31,
31
+ "265": 32,
32
+ "266": 33,
33
+ "267": 34,
34
+ "268": 35,
35
+ "269": 36,
36
+ "272": 37,
37
+ "273": 38,
38
+ "274": 39,
39
+ "275": 40,
40
+ "276": 41,
41
+ "277": 42,
42
+ "278": 43,
43
+ "281": 44,
44
+ "282": 45,
45
+ "285": 46,
46
+ "288": 47,
47
+ "291": 48,
48
+ "292": 49,
49
+ "293": 50,
50
+ "294": 51,
51
+ "295": 52,
52
+ "296": 53,
53
+ "297": 54,
54
+ "299": 55,
55
+ "300": 56,
56
+ "301": 57,
57
+ "303": 58,
58
+ "304": 59,
59
+ "305": 60,
60
+ "306": 61,
61
+ "308": 62,
62
+ "309": 63,
63
+ "311": 64,
64
+ "312": 65,
65
+ "316": 66,
66
+ "318": 67,
67
+ "320": 68,
68
+ "321": 69,
69
+ "323": 70,
70
+ "324": 71,
71
+ "325": 72,
72
+ "326": 73,
73
+ "327": 74,
74
+ "329": 75,
75
+ "331": 76,
76
+ "332": 77,
77
+ "336": 78,
78
+ "337": 79,
79
+ "342": 80,
80
+ "343": 81,
81
+ "344": 82,
82
+ "346": 83,
83
+ "347": 84,
84
+ "348": 85,
85
+ "349": 86,
86
+ "351": 87,
87
+ "354": 88,
88
+ "355": 89,
89
+ "359": 90,
90
+ "360": 91,
91
+ "361": 92,
92
+ "369": 93,
93
+ "370": 94,
94
+ "372": 95,
95
+ "373": 96,
96
+ "374": 97,
97
+ "375": 98,
98
+ "376": 99,
99
+ "380": 100,
100
+ "383": 101,
101
+ "384": 102,
102
+ "385": 103,
103
+ "387": 104,
104
+ "388": 105,
105
+ "390": 106,
106
+ "391": 107,
107
+ "395": 108,
108
+ "396": 109,
109
+ "402": 110,
110
+ "403": 111,
111
+ "404": 112,
112
+ "408": 113,
113
+ "409": 114,
114
+ "414": 115,
115
+ "417": 116,
116
+ "424": 117,
117
+ "428": 118,
118
+ "436": 119,
119
+ "437": 120,
120
+ "438": 121,
121
+ "439": 122,
122
+ "444": 123,
123
+ "447": 124,
124
+ "450": 125,
125
+ "451": 126,
126
+ "453": 127,
127
+ "454": 128,
128
+ "459": 129,
129
+ "460": 130,
130
+ "461": 131,
131
+ "462": 132,
132
+ "463": 133,
133
+ "466": 134,
134
+ "470": 135,
135
+ "472": 136,
136
+ "478": 137,
137
+ "483": 138,
138
+ "485": 139,
139
+ "490": 140,
140
+ "496": 141,
141
+ "501": 142,
142
+ "503": 143,
143
+ "506": 144,
144
+ "511": 145,
145
+ "513": 146,
146
+ "514": 147,
147
+ "519": 148,
148
+ "520": 149,
149
+ "521": 150,
150
+ "523": 151,
151
+ "525": 152,
152
+ "531": 153,
153
+ "537": 154,
154
+ "539": 155,
155
+ "540": 156,
156
+ "541": 157,
157
+ "546": 158,
158
+ "548": 159,
159
+ "550": 160,
160
+ "554": 161,
161
+ "566": 162,
162
+ "569": 163,
163
+ "575": 164,
164
+ "579": 165,
165
+ "580": 166,
166
+ "581": 167,
167
+ "582": 168,
168
+ "588": 169,
169
+ "592": 170,
170
+ "593": 171,
171
+ "594": 172,
172
+ "603": 173,
173
+ "613": 174,
174
+ "614": 175,
175
+ "628": 176,
176
+ "630": 177,
177
+ "635": 178,
178
+ "638": 179,
179
+ "648": 180,
180
+ "649": 181,
181
+ "651": 182,
182
+ "653": 183,
183
+ "655": 184,
184
+ "656": 185,
185
+ "664": 186,
186
+ "665": 187,
187
+ "668": 188,
188
+ "671": 189,
189
+ "676": 190,
190
+ "677": 191,
191
+ "687": 192,
192
+ "688": 193,
193
+ "689": 194,
194
+ "708": 195,
195
+ "710": 196,
196
+ "712": 197,
197
+ "713": 198,
198
+ "716": 199,
199
+ "729": 200,
200
+ "737": 201,
201
+ "738": 202,
202
+ "743": 203,
203
+ "749": 204,
204
+ "751": 205,
205
+ "754": 206,
206
+ "757": 207,
207
+ "762": 208,
208
+ "778": 209,
209
+ "779": 210,
210
+ "782": 211,
211
+ "784": 212,
212
+ "797": 213,
213
+ "799": 214,
214
+ "802": 215,
215
+ "805": 216,
216
+ "809": 217,
217
+ "818": 218,
218
+ "822": 219,
219
+ "830": 220,
220
+ "831": 221,
221
+ "834": 222,
222
+ "840": 223,
223
+ "846": 224,
224
+ "857": 225,
225
+ "864": 226,
226
+ "865": 227,
227
+ "867": 228,
228
+ "880": 229,
229
+ "884": 230,
230
+ "893": 231,
231
+ "896": 232,
232
+ "899": 233,
233
+ "911": 234,
234
+ "912": 235,
235
+ "924": 236,
236
+ "934": 237,
237
+ "936": 238,
238
+ "938": 239,
239
+ "940": 240,
240
+ "944": 241,
241
+ "945": 242,
242
+ "951": 243,
243
+ "953": 244,
244
+ "958": 245,
245
+ "959": 246,
246
+ "967": 247,
247
+ "969": 248,
248
+ "971": 249,
249
+ "978": 250,
250
+ "981": 251,
251
+ "983": 252,
252
+ "991": 253,
253
+ "992": 254,
254
+ "998": 255,
255
+ "1007": 256,
256
+ "1008": 257,
257
+ "1022": 258,
258
+ "1028": 259,
259
+ "1030": 260,
260
+ "1031": 261,
261
+ "1037": 262,
262
+ "1040": 263,
263
+ "1048": 264,
264
+ "1052": 265,
265
+ "1069": 266,
266
+ "1072": 267,
267
+ "1080": 268,
268
+ "1082": 269,
269
+ "1083": 270,
270
+ "1089": 271,
271
+ "1097": 272,
272
+ "1098": 273,
273
+ "1099": 274,
274
+ "1113": 275,
275
+ "1116": 276,
276
+ "1121": 277,
277
+ "1126": 278,
278
+ "1138": 279,
279
+ "1149": 280,
280
+ "1157": 281,
281
+ "1166": 282,
282
+ "1169": 283,
283
+ "1172": 284,
284
+ "1189": 285,
285
+ "1195": 286,
286
+ "1206": 287,
287
+ "1213": 288,
288
+ "1218": 289,
289
+ "1224": 290,
290
+ "1237": 291,
291
+ "1239": 292,
292
+ "1263": 293,
293
+ "1279": 294,
294
+ "1280": 295,
295
+ "1295": 296,
296
+ "1296": 297,
297
+ "1299": 298,
298
+ "1317": 299,
299
+ "1321": 300,
300
+ "1323": 301,
301
+ "1327": 302,
302
+ "1331": 303,
303
+ "1332": 304,
304
+ "1342": 305,
305
+ "1347": 306,
306
+ "1355": 307,
307
+ "1367": 308,
308
+ "1370": 309,
309
+ "1376": 310,
310
+ "1380": 311,
311
+ "1391": 312,
312
+ "1394": 313,
313
+ "1395": 314,
314
+ "1400": 315,
315
+ "1421": 316,
316
+ "1437": 317,
317
+ "1446": 318,
318
+ "1448": 319,
319
+ "1466": 320,
320
+ "1469": 321,
321
+ "1474": 322,
322
+ "1485": 323,
323
+ "1499": 324,
324
+ "1501": 325,
325
+ "1517": 326,
326
+ "1522": 327,
327
+ "1529": 328,
328
+ "1540": 329,
329
+ "1543": 330,
330
+ "1557": 331,
331
+ "1558": 332,
332
+ "1560": 333,
333
+ "1564": 334,
334
+ "1589": 335,
335
+ "1592": 336,
336
+ "1601": 337,
337
+ "1604": 338,
338
+ "1610": 339,
339
+ "1612": 340,
340
+ "1624": 341,
341
+ "1645": 342,
342
+ "1646": 343,
343
+ "1652": 344,
344
+ "1658": 345,
345
+ "1662": 346,
346
+ "1665": 347,
347
+ "1678": 348,
348
+ "1685": 349,
349
+ "1709": 350,
350
+ "1744": 351,
351
+ "1762": 352,
352
+ "1764": 353,
353
+ "1768": 354,
354
+ "1773": 355,
355
+ "1794": 356,
356
+ "1826": 357,
357
+ "1832": 358,
358
+ "1841": 359,
359
+ "1860": 360,
360
+ "1864": 361,
361
+ "1867": 362,
362
+ "1871": 363,
363
+ "1880": 364,
364
+ "1897": 365,
365
+ "1922": 366,
366
+ "1955": 367,
367
+ "1962": 368,
368
+ "1964": 369,
369
+ "1978": 370,
370
+ "1989": 371,
371
+ "1995": 372,
372
+ "2000": 373,
373
+ "2016": 374,
374
+ "2041": 375,
375
+ "2047": 376,
376
+ "2067": 377,
377
+ "2068": 378,
378
+ "2070": 379,
379
+ "2092": 380,
380
+ "2099": 381,
381
+ "2106": 382,
382
+ "2107": 383,
383
+ "2117": 384,
384
+ "2119": 385,
385
+ "2145": 386,
386
+ "2159": 387,
387
+ "2171": 388,
388
+ "2172": 389,
389
+ "2177": 390,
390
+ "2200": 391,
391
+ "2201": 392,
392
+ "2215": 393,
393
+ "2223": 394,
394
+ "2227": 395,
395
+ "2252": 396,
396
+ "2254": 397,
397
+ "2259": 398,
398
+ "2269": 399,
399
+ "2295": 400,
400
+ "2308": 401,
401
+ "2322": 402,
402
+ "2347": 403,
403
+ "2385": 404,
404
+ "2389": 405,
405
+ "2392": 406,
406
+ "2423": 407,
407
+ "2442": 408,
408
+ "2445": 409,
409
+ "2473": 410,
410
+ "2480": 411,
411
+ "2483": 412,
412
+ "2486": 413,
413
+ "2497": 414,
414
+ "2512": 415,
415
+ "2558": 416,
416
+ "2579": 417,
417
+ "2605": 418,
418
+ "2629": 419,
419
+ "2642": 420,
420
+ "2649": 421,
421
+ "2679": 422,
422
+ "2700": 423,
423
+ "2709": 424,
424
+ "2727": 425,
425
+ "2739": 426,
426
+ "2749": 427,
427
+ "2751": 428,
428
+ "2762": 429,
429
+ "2807": 430,
430
+ "2827": 431,
431
+ "2836": 432,
432
+ "2840": 433,
433
+ "2852": 434,
434
+ "2853": 435,
435
+ "2854": 436,
436
+ "2910": 437,
437
+ "2917": 438,
438
+ "2960": 439,
439
+ "2961": 440,
440
+ "2967": 441,
441
+ "2979": 442,
442
+ "2995": 443,
443
+ "3026": 444,
444
+ "3055": 445,
445
+ "3067": 446,
446
+ "3074": 447,
447
+ "3078": 448,
448
+ "3091": 449,
449
+ "3105": 450,
450
+ "3117": 451,
451
+ "3127": 452,
452
+ "3197": 453,
453
+ "3209": 454,
454
+ "3212": 455,
455
+ "3213": 456,
456
+ "3223": 457,
457
+ "3237": 458,
458
+ "3276": 459,
459
+ "3282": 460,
460
+ "3289": 461,
461
+ "3315": 462,
462
+ "3326": 463,
463
+ "3352": 464,
464
+ "3375": 465,
465
+ "3394": 466,
466
+ "3395": 467,
467
+ "3415": 468,
468
+ "3429": 469,
469
+ "3444": 470,
470
+ "3496": 471,
471
+ "3497": 472,
472
+ "3510": 473,
473
+ "3512": 474,
474
+ "3521": 475,
475
+ "3527": 476,
476
+ "3528": 477,
477
+ "3536": 478,
478
+ "3557": 479,
479
+ "3567": 480,
480
+ "3609": 481,
481
+ "3614": 482,
482
+ "3635": 483,
483
+ "3667": 484,
484
+ "3678": 485,
485
+ "3687": 486,
486
+ "3689": 487,
487
+ "3698": 488,
488
+ "3703": 489,
489
+ "3714": 490,
490
+ "3716": 491,
491
+ "3769": 492,
492
+ "3833": 493,
493
+ "3841": 494,
494
+ "3846": 495,
495
+ "3887": 496,
496
+ "3904": 497,
497
+ "3913": 498,
498
+ "3920": 499,
499
+ "3935": 500,
500
+ "3969": 501,
501
+ "3972": 502,
502
+ "4039": 503,
503
+ "4042": 504,
504
+ "4046": 505,
505
+ "4057": 506,
506
+ "4087": 507,
507
+ "4247": 508,
508
+ "4298": 509,
509
+ "4306": 510,
510
+ "4317": 511,
511
+ "4319": 512,
512
+ "4338": 513,
513
+ "4371": 514,
514
+ "4378": 515,
515
+ "4381": 516,
516
+ "4406": 517,
517
+ "4411": 518,
518
+ "4415": 519,
519
+ "4428": 520,
520
+ "4433": 521,
521
+ "4457": 522,
522
+ "4458": 523,
523
+ "4528": 524,
524
+ "4543": 525,
525
+ "4545": 526,
526
+ "4547": 527,
527
+ "4581": 528,
528
+ "4590": 529,
529
+ "4633": 530,
530
+ "4634": 531,
531
+ "4637": 532,
532
+ "4647": 533,
533
+ "4669": 534,
534
+ "4675": 535,
535
+ "4692": 536,
536
+ "4704": 537,
537
+ "4744": 538,
538
+ "4749": 539,
539
+ "4766": 540,
540
+ "4781": 541,
541
+ "4849": 542,
542
+ "4902": 543,
543
+ "4915": 544,
544
+ "4917": 545,
545
+ "4919": 546,
546
+ "4941": 547,
547
+ "4988": 548,
548
+ "5048": 549,
549
+ "5066": 550,
550
+ "5169": 551,
551
+ "5171": 552,
552
+ "5178": 553,
553
+ "5208": 554,
554
+ "5276": 555,
555
+ "5308": 556,
556
+ "5320": 557,
557
+ "5325": 558,
558
+ "5335": 559,
559
+ "5347": 560,
560
+ "5362": 561,
561
+ "5367": 562,
562
+ "5389": 563,
563
+ "5477": 564,
564
+ "5485": 565,
565
+ "5512": 566,
566
+ "5518": 567,
567
+ "5531": 568,
568
+ "5541": 569,
569
+ "5554": 570,
570
+ "5615": 571,
571
+ "5641": 572,
572
+ "5642": 573,
573
+ "5670": 574,
574
+ "5682": 575,
575
+ "5724": 576,
576
+ "5730": 577,
577
+ "5770": 578,
578
+ "5797": 579,
579
+ "5801": 580,
580
+ "5808": 581,
581
+ "5919": 582,
582
+ "6000": 583,
583
+ "6027": 584,
584
+ "6033": 585,
585
+ "6091": 586,
586
+ "6133": 587,
587
+ "6181": 588,
588
+ "6200": 589,
589
+ "6216": 590,
590
+ "6217": 591,
591
+ "6225": 592,
592
+ "6229": 593,
593
+ "6252": 594,
594
+ "6263": 595,
595
+ "6292": 596,
596
+ "6293": 597,
597
+ "6316": 598,
598
+ "6321": 599,
599
+ "6347": 600,
600
+ "6348": 601,
601
+ "6388": 602,
602
+ "6489": 603,
603
+ "6491": 604,
604
+ "6519": 605,
605
+ "6526": 606,
606
+ "6632": 607,
607
+ "6697": 608,
608
+ "6723": 609,
609
+ "6730": 610,
610
+ "6733": 611,
611
+ "6747": 612,
612
+ "6754": 613,
613
+ "6792": 614,
614
+ "6824": 615,
615
+ "6885": 616,
616
+ "6902": 617,
617
+ "6916": 618,
618
+ "6960": 619,
619
+ "6962": 620,
620
+ "6987": 621,
621
+ "6993": 622,
622
+ "7005": 623,
623
+ "7006": 624,
624
+ "7018": 625,
625
+ "7063": 626,
626
+ "7138": 627,
627
+ "7143": 628,
628
+ "7164": 629,
629
+ "7206": 630,
630
+ "7210": 631,
631
+ "7304": 632,
632
+ "7363": 633,
633
+ "7385": 634,
634
+ "7453": 635,
635
+ "7495": 636,
636
+ "7515": 637,
637
+ "7528": 638,
638
+ "7710": 639,
639
+ "7835": 640,
640
+ "7836": 641,
641
+ "7870": 642,
642
+ "7893": 643,
643
+ "7962": 644,
644
+ "7992": 645,
645
+ "8083": 646,
646
+ "8110": 647,
647
+ "8112": 648,
648
+ "8122": 649,
649
+ "8126": 650,
650
+ "8136": 651,
651
+ "8186": 652,
652
+ "8213": 653,
653
+ "8249": 654,
654
+ "8393": 655,
655
+ "8407": 656,
656
+ "8424": 657,
657
+ "8458": 658,
658
+ "8481": 659,
659
+ "8536": 660,
660
+ "8566": 661,
661
+ "8568": 662,
662
+ "8629": 663,
663
+ "8733": 664,
664
+ "8747": 665,
665
+ "8770": 666,
666
+ "8778": 667,
667
+ "8783": 668,
668
+ "8801": 669,
669
+ "8811": 670,
670
+ "8835": 671,
671
+ "8862": 672,
672
+ "8869": 673,
673
+ "8890": 674,
674
+ "8938": 675,
675
+ "9004": 676,
676
+ "9008": 677,
677
+ "9011": 678,
678
+ "9048": 679,
679
+ "9110": 680,
680
+ "9120": 681,
681
+ "9157": 682,
682
+ "9225": 683,
683
+ "9252": 684,
684
+ "9355": 685,
685
+ "9427": 686,
686
+ "9465": 687,
687
+ "9466": 688,
688
+ "9511": 689,
689
+ "9594": 690,
690
+ "9630": 691,
691
+ "9637": 692,
692
+ "9652": 693,
693
+ "9686": 694,
694
+ "9700": 695,
695
+ "9730": 696,
696
+ "9769": 697,
697
+ "9831": 698,
698
+ "9988": 699,
699
+ "10024": 700,
700
+ "10025": 701,
701
+ "10045": 702,
702
+ "10071": 703,
703
+ "10073": 704,
704
+ "10084": 705,
705
+ "10097": 706,
706
+ "10098": 707,
707
+ "10126": 708,
708
+ "10194": 709,
709
+ "10216": 710,
710
+ "10253": 711,
711
+ "10274": 712,
712
+ "10317": 713,
713
+ "10333": 714,
714
+ "10337": 715,
715
+ "10444": 716,
716
+ "10478": 717,
717
+ "10484": 718,
718
+ "10524": 719,
719
+ "10540": 720,
720
+ "10574": 721,
721
+ "10581": 722,
722
+ "10609": 723,
723
+ "10628": 724,
724
+ "10649": 725,
725
+ "10672": 726,
726
+ "10696": 727,
727
+ "10727": 728,
728
+ "10728": 729,
729
+ "10732": 730,
730
+ "10737": 731,
731
+ "10746": 732,
732
+ "10773": 733,
733
+ "10776": 734,
734
+ "10832": 735,
735
+ "10900": 736,
736
+ "10910": 737,
737
+ "10946": 738,
738
+ "10994": 739,
739
+ "11015": 740,
740
+ "11091": 741,
741
+ "11222": 742,
742
+ "11249": 743,
743
+ "11269": 744,
744
+ "11280": 745,
745
+ "11305": 746,
746
+ "11354": 747,
747
+ "11368": 748,
748
+ "11369": 749,
749
+ "11388": 750,
750
+ "11403": 751,
751
+ "11594": 752,
752
+ "11620": 753,
753
+ "11707": 754,
754
+ "11715": 755,
755
+ "11752": 756,
756
+ "11810": 757,
757
+ "11814": 758,
758
+ "11857": 759,
759
+ "11860": 760,
760
+ "11885": 761,
761
+ "12052": 762,
762
+ "12077": 763,
763
+ "12108": 764,
764
+ "12134": 765,
765
+ "12155": 766,
766
+ "12183": 767,
767
+ "12260": 768,
768
+ "12341": 769,
769
+ "12440": 770,
770
+ "12489": 771,
771
+ "12635": 772,
772
+ "12646": 773,
773
+ "12674": 774,
774
+ "12717": 775,
775
+ "12812": 776,
776
+ "12821": 777,
777
+ "12826": 778,
778
+ "12997": 779,
779
+ "13028": 780,
780
+ "13081": 781,
781
+ "13095": 782,
782
+ "13102": 783,
783
+ "13115": 784,
784
+ "13140": 785,
785
+ "13154": 786,
786
+ "13178": 787,
787
+ "13264": 788,
788
+ "13279": 789,
789
+ "13387": 790,
790
+ "13441": 791,
791
+ "13493": 792,
792
+ "13510": 793,
793
+ "13559": 794,
794
+ "13576": 795,
795
+ "13616": 796,
796
+ "13645": 797,
797
+ "13652": 798,
798
+ "13827": 799,
799
+ "13910": 800,
800
+ "14080": 801,
801
+ "14107": 802,
802
+ "14113": 803,
803
+ "14122": 804,
804
+ "14151": 805,
805
+ "14210": 806,
806
+ "14287": 807,
807
+ "14448": 808,
808
+ "14605": 809,
809
+ "14606": 810,
810
+ "14609": 811,
811
+ "14635": 812,
812
+ "14720": 813,
813
+ "14746": 814,
814
+ "14796": 815,
815
+ "14949": 816,
816
+ "15003": 817,
817
+ "15104": 818,
818
+ "15184": 819,
819
+ "15190": 820,
820
+ "15192": 821,
821
+ "15222": 822,
822
+ "15279": 823,
823
+ "15286": 824,
824
+ "15362": 825,
825
+ "15377": 826,
826
+ "15433": 827,
827
+ "15462": 828,
828
+ "15482": 829,
829
+ "15601": 830,
830
+ "15607": 831,
831
+ "15627": 832,
832
+ "15715": 833,
833
+ "15769": 834,
834
+ "15772": 835,
835
+ "15887": 836,
836
+ "15938": 837,
837
+ "15959": 838,
838
+ "15962": 839,
839
+ "16080": 840,
840
+ "16262": 841,
841
+ "16338": 842,
842
+ "16339": 843,
843
+ "16382": 844,
844
+ "16697": 845,
845
+ "16711": 846,
846
+ "16833": 847,
847
+ "16845": 848,
848
+ "16869": 849,
849
+ "16903": 850,
850
+ "16915": 851,
851
+ "16948": 852,
852
+ "16960": 853,
853
+ "16977": 854,
854
+ "17028": 855,
855
+ "17060": 856,
856
+ "17105": 857,
857
+ "17187": 858,
858
+ "17251": 859,
859
+ "17258": 860,
860
+ "17270": 861,
861
+ "17358": 862,
862
+ "17392": 863,
863
+ "17434": 864,
864
+ "17449": 865,
865
+ "17452": 866,
866
+ "17514": 867,
867
+ "17544": 868,
868
+ "17580": 869,
869
+ "17606": 870,
870
+ "17684": 871,
871
+ "17757": 872,
872
+ "17797": 873,
873
+ "17872": 874,
874
+ "17930": 875,
875
+ "17996": 876,
876
+ "18205": 877,
877
+ "18274": 878,
878
+ "18316": 879,
879
+ "18439": 880,
880
+ "18525": 881,
881
+ "18536": 882,
882
+ "18541": 883,
883
+ "18595": 884,
884
+ "18619": 885,
885
+ "18638": 886,
886
+ "18680": 887,
887
+ "18812": 888,
888
+ "18931": 889,
889
+ "18970": 890,
890
+ "19031": 891,
891
+ "19067": 892,
892
+ "19126": 893,
893
+ "19216": 894,
894
+ "19227": 895,
895
+ "19290": 896,
896
+ "19329": 897,
897
+ "19394": 898,
898
+ "19540": 899,
899
+ "19733": 900,
900
+ "19736": 901,
901
+ "19776": 902,
902
+ "19866": 903,
903
+ "19907": 904,
904
+ "19972": 905,
905
+ "20053": 906,
906
+ "20100": 907,
907
+ "20103": 908,
908
+ "20108": 909,
909
+ "20110": 910,
910
+ "20233": 911,
911
+ "20243": 912,
912
+ "20245": 913,
913
+ "20358": 914,
914
+ "20370": 915,
915
+ "20393": 916,
916
+ "20399": 917,
917
+ "20531": 918,
918
+ "20568": 919,
919
+ "20605": 920,
920
+ "20607": 921,
921
+ "20708": 922,
922
+ "20735": 923,
923
+ "20822": 924,
924
+ "21047": 925,
925
+ "21075": 926,
926
+ "21143": 927,
927
+ "21152": 928,
928
+ "21200": 929,
929
+ "21434": 930,
930
+ "21519": 931,
931
+ "21538": 932,
932
+ "21830": 933,
933
+ "21887": 934,
934
+ "21920": 935,
935
+ "21946": 936,
936
+ "22059": 937,
937
+ "22377": 938,
938
+ "22460": 939,
939
+ "22514": 940,
940
+ "22544": 941,
941
+ "22631": 942,
942
+ "22711": 943,
943
+ "22997": 944,
944
+ "23095": 945,
945
+ "23114": 946,
946
+ "23135": 947,
947
+ "23254": 948,
948
+ "23423": 949,
949
+ "23553": 950,
950
+ "23576": 951,
951
+ "23577": 952,
952
+ "23637": 953,
953
+ "23671": 954,
954
+ "23697": 955,
955
+ "23774": 956,
956
+ "23834": 957,
957
+ "24108": 958,
958
+ "24201": 959,
959
+ "24301": 960,
960
+ "24409": 961,
961
+ "24470": 962,
962
+ "24520": 963,
963
+ "24614": 964,
964
+ "24625": 965,
965
+ "24705": 966,
966
+ "24823": 967,
967
+ "25075": 968,
968
+ "25088": 969,
969
+ "25089": 970,
970
+ "25098": 971,
971
+ "25155": 972,
972
+ "25160": 973,
973
+ "25196": 974,
974
+ "25228": 975,
975
+ "25282": 976,
976
+ "25286": 977,
977
+ "25295": 978,
978
+ "25356": 979,
979
+ "25455": 980,
980
+ "25526": 981,
981
+ "25540": 982,
982
+ "25568": 983,
983
+ "25626": 984,
984
+ "25632": 985,
985
+ "25738": 986,
986
+ "25746": 987,
987
+ "25985": 988,
988
+ "25994": 989,
989
+ "26047": 990,
990
+ "26205": 991,
991
+ "26407": 992,
992
+ "26414": 993,
993
+ "26419": 994,
994
+ "26427": 995,
995
+ "26458": 996,
996
+ "26483": 997,
997
+ "26494": 998,
998
+ "26514": 999,
999
+ "26577": 1000,
1000
+ "26675": 1001,
1001
+ "26931": 1002,
1002
+ "27190": 1003,
1003
+ "27282": 1004,
1004
+ "27417": 1005,
1005
+ "27428": 1006,
1006
+ "27578": 1007,
1007
+ "27835": 1008,
1008
+ "27843": 1009,
1009
+ "27845": 1010,
1010
+ "27865": 1011,
1011
+ "27990": 1012,
1012
+ "28029": 1013,
1013
+ "28043": 1014,
1014
+ "28119": 1015,
1015
+ "28246": 1016,
1016
+ "28256": 1017,
1017
+ "28344": 1018,
1018
+ "28400": 1019,
1019
+ "28625": 1020,
1020
+ "28639": 1021,
1021
+ "28658": 1022,
1022
+ "28676": 1023,
1023
+ "28705": 1024,
1024
+ "28787": 1025,
1025
+ "28793": 1026,
1026
+ "28900": 1027,
1027
+ "28963": 1028,
1028
+ "29008": 1029,
1029
+ "29028": 1030,
1030
+ "29045": 1031,
1031
+ "29141": 1032,
1032
+ "29294": 1033,
1033
+ "29350": 1034,
1034
+ "29413": 1035,
1035
+ "29465": 1036,
1036
+ "29511": 1037,
1037
+ "29856": 1038,
1038
+ "29876": 1039,
1039
+ "29928": 1040,
1040
+ "29956": 1041,
1041
+ "29963": 1042,
1042
+ "30149": 1043,
1043
+ "30223": 1044,
1044
+ "30234": 1045,
1045
+ "30331": 1046,
1046
+ "30477": 1047,
1047
+ "30528": 1048,
1048
+ "30540": 1049,
1049
+ "30607": 1050,
1050
+ "30710": 1051,
1051
+ "30805": 1052,
1052
+ "31157": 1053,
1053
+ "31225": 1054,
1054
+ "31311": 1055,
1055
+ "31349": 1056,
1056
+ "31469": 1057,
1057
+ "31531": 1058,
1058
+ "31548": 1059,
1059
+ "31674": 1060,
1060
+ "31853": 1061,
1061
+ "31952": 1062,
1062
+ "31967": 1063,
1063
+ "32190": 1064,
1064
+ "32314": 1065,
1065
+ "32710": 1066,
1066
+ "32752": 1067,
1067
+ "32759": 1068,
1068
+ "32850": 1069,
1069
+ "32878": 1070,
1070
+ "33015": 1071,
1071
+ "33192": 1072,
1072
+ "33397": 1073,
1073
+ "33515": 1074,
1074
+ "33823": 1075,
1075
+ "33853": 1076,
1076
+ "33896": 1077,
1077
+ "34081": 1078,
1078
+ "34152": 1079,
1079
+ "34182": 1080,
1080
+ "34435": 1081,
1081
+ "34437": 1082,
1082
+ "34565": 1083,
1083
+ "34815": 1084,
1084
+ "34822": 1085,
1085
+ "34830": 1086,
1086
+ "34850": 1087,
1087
+ "34860": 1088,
1088
+ "34928": 1089,
1089
+ "35010": 1090,
1090
+ "35150": 1091,
1091
+ "35220": 1092,
1092
+ "35450": 1093,
1093
+ "35497": 1094,
1094
+ "35560": 1095,
1095
+ "35662": 1096,
1096
+ "35785": 1097,
1097
+ "35838": 1098,
1098
+ "35853": 1099,
1099
+ "35904": 1100,
1100
+ "36099": 1101,
1101
+ "36436": 1102,
1102
+ "36444": 1103,
1103
+ "36643": 1104,
1104
+ "36890": 1105,
1105
+ "37017": 1106,
1106
+ "37111": 1107,
1107
+ "37232": 1108,
1108
+ "37244": 1109,
1109
+ "37511": 1110,
1110
+ "37547": 1111,
1111
+ "37930": 1112,
1112
+ "38101": 1113,
1113
+ "38169": 1114,
1114
+ "38185": 1115,
1115
+ "38279": 1116,
1116
+ "38415": 1117,
1117
+ "38610": 1118,
1118
+ "38639": 1119,
1119
+ "38812": 1120,
1120
+ "38828": 1121,
1121
+ "38893": 1122,
1122
+ "39036": 1123,
1123
+ "39073": 1124,
1124
+ "39112": 1125,
1125
+ "39124": 1126,
1126
+ "39180": 1127,
1127
+ "39225": 1128,
1128
+ "39294": 1129,
1129
+ "39298": 1130,
1130
+ "39311": 1131,
1131
+ "39451": 1132,
1132
+ "39583": 1133,
1133
+ "39667": 1134,
1134
+ "39710": 1135,
1135
+ "39830": 1136,
1136
+ "39944": 1137,
1137
+ "39961": 1138,
1138
+ "39992": 1139,
1139
+ "40055": 1140,
1140
+ "40110": 1141,
1141
+ "40492": 1142,
1142
+ "40625": 1143,
1143
+ "40860": 1144,
1144
+ "40945": 1145,
1145
+ "40967": 1146,
1146
+ "41071": 1147,
1147
+ "41093": 1148,
1148
+ "41236": 1149,
1149
+ "41278": 1150,
1150
+ "41305": 1151,
1151
+ "41376": 1152,
1152
+ "41625": 1153,
1153
+ "41664": 1154,
1154
+ "41921": 1155,
1155
+ "41934": 1156,
1156
+ "41967": 1157,
1157
+ "41987": 1158,
1158
+ "42441": 1159,
1159
+ "42502": 1160,
1160
+ "42657": 1161,
1161
+ "42723": 1162,
1162
+ "42750": 1163,
1163
+ "42935": 1164,
1164
+ "43014": 1165,
1165
+ "43222": 1166,
1166
+ "43296": 1167,
1167
+ "43301": 1168,
1168
+ "44190": 1169,
1169
+ "44338": 1170,
1170
+ "44415": 1171,
1171
+ "44469": 1172,
1172
+ "44545": 1173,
1173
+ "44554": 1174,
1174
+ "44750": 1175,
1175
+ "44797": 1176,
1176
+ "44906": 1177,
1177
+ "45009": 1178,
1178
+ "45103": 1179,
1179
+ "45111": 1180,
1180
+ "45168": 1181,
1181
+ "45558": 1182,
1182
+ "45866": 1183,
1183
+ "45876": 1184,
1184
+ "45961": 1185,
1185
+ "46245": 1186,
1186
+ "46429": 1187,
1187
+ "46494": 1188,
1188
+ "46591": 1189,
1189
+ "46931": 1190,
1190
+ "47015": 1191,
1191
+ "47026": 1192,
1192
+ "47178": 1193,
1193
+ "47206": 1194,
1194
+ "47484": 1195,
1195
+ "47535": 1196,
1196
+ "47615": 1197,
1197
+ "47767": 1198,
1198
+ "47820": 1199,
1199
+ "47822": 1200,
1200
+ "48000": 1201,
1201
+ "48067": 1202,
1202
+ "48328": 1203,
1203
+ "48416": 1204,
1204
+ "48454": 1205,
1205
+ "48850": 1206,
1206
+ "48931": 1207,
1207
+ "48999": 1208,
1208
+ "49236": 1209,
1209
+ "49551": 1210,
1210
+ "49591": 1211,
1211
+ "49602": 1212,
1212
+ "50010": 1213,
1213
+ "50103": 1214,
1214
+ "50502": 1215,
1215
+ "50914": 1216,
1216
+ "51205": 1217,
1217
+ "51441": 1218,
1218
+ "51526": 1219,
1219
+ "51737": 1220,
1220
+ "52087": 1221,
1221
+ "52311": 1222,
1222
+ "52330": 1223,
1223
+ "52360": 1224,
1224
+ "52462": 1225,
1225
+ "52596": 1226,
1226
+ "52603": 1227,
1227
+ "52762": 1228,
1228
+ "52777": 1229,
1229
+ "52962": 1230,
1230
+ "53187": 1231,
1231
+ "53358": 1232,
1232
+ "53377": 1233,
1233
+ "53403": 1234,
1234
+ "53543": 1235,
1235
+ "53565": 1236,
1236
+ "53696": 1237,
1237
+ "53722": 1238,
1238
+ "53902": 1239,
1239
+ "53990": 1240,
1240
+ "54097": 1241,
1241
+ "54176": 1242,
1242
+ "54266": 1243,
1243
+ "54272": 1244,
1244
+ "54485": 1245,
1245
+ "54681": 1246,
1246
+ "54776": 1247,
1247
+ "54788": 1248,
1248
+ "54860": 1249,
1249
+ "54921": 1250,
1250
+ "55002": 1251,
1251
+ "55122": 1252,
1252
+ "55271": 1253,
1253
+ "55279": 1254,
1254
+ "55300": 1255,
1255
+ "55424": 1256,
1256
+ "55451": 1257,
1257
+ "55672": 1258,
1258
+ "55779": 1259,
1259
+ "55862": 1260,
1260
+ "55880": 1261,
1261
+ "56094": 1262,
1262
+ "56099": 1263,
1263
+ "56184": 1264,
1264
+ "56246": 1265,
1265
+ "56503": 1266,
1266
+ "56528": 1267,
1267
+ "56552": 1268,
1268
+ "56589": 1269,
1269
+ "56692": 1270,
1270
+ "56809": 1271,
1271
+ "56868": 1272,
1272
+ "56970": 1273,
1273
+ "57258": 1274,
1274
+ "57730": 1275,
1275
+ "57766": 1276,
1276
+ "57839": 1277,
1277
+ "57973": 1278,
1278
+ "58132": 1279,
1279
+ "58147": 1280,
1280
+ "58197": 1281,
1281
+ "58315": 1282,
1282
+ "58369": 1283,
1283
+ "58576": 1284,
1284
+ "58633": 1285,
1285
+ "58708": 1286,
1286
+ "58899": 1287,
1287
+ "59004": 1288,
1288
+ "59042": 1289,
1289
+ "59548": 1290,
1290
+ "60024": 1291,
1291
+ "60050": 1292,
1292
+ "60477": 1293,
1293
+ "60577": 1294,
1294
+ "61194": 1295,
1295
+ "61344": 1296,
1296
+ "61353": 1297,
1297
+ "61387": 1298,
1298
+ "61454": 1299,
1299
+ "61745": 1300,
1300
+ "62067": 1301,
1301
+ "62090": 1302,
1302
+ "62344": 1303,
1303
+ "62444": 1304,
1304
+ "62552": 1305,
1305
+ "62822": 1306,
1306
+ "63099": 1307,
1307
+ "63278": 1308,
1308
+ "63340": 1309,
1309
+ "63423": 1310,
1310
+ "63698": 1311,
1311
+ "64032": 1312,
1312
+ "64099": 1313,
1313
+ "64115": 1314,
1314
+ "64200": 1315,
1315
+ "64281": 1316,
1316
+ "64345": 1317,
1317
+ "64487": 1318,
1318
+ "64753": 1319,
1319
+ "64934": 1320,
1320
+ "65166": 1321,
1321
+ "65856": 1322,
1322
+ "66163": 1323,
1323
+ "66652": 1324,
1324
+ "66696": 1325,
1325
+ "66780": 1326,
1326
+ "66815": 1327,
1327
+ "66842": 1328,
1328
+ "66852": 1329,
1329
+ "66999": 1330,
1330
+ "67100": 1331,
1331
+ "67443": 1332,
1332
+ "67554": 1333,
1333
+ "67717": 1334,
1334
+ "68146": 1335,
1335
+ "68151": 1336,
1336
+ "68330": 1337,
1337
+ "68396": 1338,
1338
+ "68593": 1339,
1339
+ "68669": 1340,
1340
+ "68817": 1341,
1341
+ "69034": 1342,
1342
+ "69239": 1343,
1343
+ "69406": 1344,
1344
+ "69407": 1345,
1345
+ "69432": 1346,
1346
+ "69578": 1347,
1347
+ "69694": 1348,
1348
+ "69814": 1349,
1349
+ "69947": 1350,
1350
+ "70138": 1351,
1351
+ "70257": 1352,
1352
+ "70338": 1353,
1353
+ "70383": 1354,
1354
+ "70437": 1355,
1355
+ "70854": 1356,
1356
+ "70865": 1357,
1357
+ "70866": 1358,
1358
+ "71097": 1359,
1359
+ "71253": 1360,
1360
+ "71296": 1361,
1361
+ "71398": 1362,
1362
+ "71437": 1363,
1363
+ "71544": 1364,
1364
+ "71629": 1365,
1365
+ "71826": 1366,
1366
+ "72239": 1367,
1367
+ "72343": 1368,
1368
+ "72390": 1369,
1369
+ "72583": 1370,
1370
+ "72628": 1371,
1371
+ "73077": 1372,
1372
+ "73225": 1373,
1373
+ "73512": 1374,
1374
+ "73663": 1375,
1375
+ "73866": 1376,
1376
+ "73875": 1377,
1377
+ "73911": 1378,
1378
+ "73990": 1379,
1379
+ "74261": 1380,
1380
+ "74772": 1381,
1381
+ "74961": 1382,
1382
+ "75288": 1383,
1383
+ "75401": 1384,
1384
+ "75707": 1385,
1385
+ "75802": 1386,
1386
+ "75878": 1387,
1387
+ "76063": 1388,
1388
+ "76111": 1389,
1389
+ "76181": 1390,
1390
+ "76351": 1391,
1391
+ "76535": 1392,
1392
+ "76777": 1393,
1393
+ "76871": 1394,
1394
+ "77155": 1395,
1395
+ "77467": 1396,
1396
+ "77507": 1397,
1397
+ "77510": 1398,
1398
+ "77643": 1399,
1399
+ "78418": 1400,
1400
+ "78428": 1401,
1401
+ "78540": 1402,
1402
+ "78810": 1403,
1403
+ "78968": 1404,
1404
+ "79020": 1405,
1405
+ "79212": 1406,
1406
+ "79444": 1407,
1407
+ "79807": 1408,
1408
+ "79835": 1409,
1409
+ "80024": 1410,
1410
+ "80457": 1411,
1411
+ "80701": 1412,
1412
+ "80990": 1413,
1413
+ "81585": 1414,
1414
+ "81772": 1415,
1415
+ "81807": 1416,
1416
+ "82036": 1417,
1417
+ "82123": 1418,
1418
+ "82200": 1419,
1419
+ "82629": 1420,
1420
+ "82649": 1421,
1421
+ "82863": 1422,
1422
+ "83450": 1423,
1423
+ "83571": 1424,
1424
+ "83595": 1425,
1425
+ "83921": 1426,
1426
+ "83937": 1427,
1427
+ "83977": 1428,
1428
+ "84112": 1429,
1429
+ "84189": 1430,
1430
+ "84767": 1431,
1431
+ "84807": 1432,
1432
+ "84820": 1433,
1433
+ "85210": 1434,
1434
+ "85298": 1435,
1435
+ "85369": 1436,
1436
+ "85428": 1437,
1437
+ "85530": 1438,
1438
+ "85677": 1439,
1439
+ "85724": 1440,
1440
+ "85920": 1441,
1441
+ "86084": 1442,
1442
+ "86400": 1443,
1443
+ "86518": 1444,
1444
+ "86627": 1445,
1445
+ "86656": 1446,
1446
+ "86906": 1447,
1447
+ "87034": 1448,
1448
+ "87099": 1449,
1449
+ "87120": 1450,
1450
+ "87197": 1451,
1451
+ "87200": 1452,
1452
+ "87251": 1453,
1453
+ "87512": 1454,
1454
+ "87556": 1455,
1455
+ "87685": 1456,
1456
+ "87730": 1457,
1457
+ "87770": 1458,
1458
+ "87780": 1459,
1459
+ "87802": 1460,
1460
+ "87909": 1461,
1461
+ "87996": 1462,
1462
+ "88256": 1463,
1463
+ "88295": 1464,
1464
+ "88531": 1465,
1465
+ "89049": 1466,
1466
+ "89129": 1467,
1467
+ "89615": 1468,
1468
+ "90065": 1469,
1469
+ "90099": 1470,
1470
+ "90539": 1471,
1471
+ "90745": 1472,
1472
+ "90818": 1473,
1473
+ "91010": 1474,
1474
+ "91065": 1475,
1475
+ "91427": 1476,
1476
+ "91905": 1477,
1477
+ "92347": 1478,
1478
+ "92510": 1479,
1479
+ "92644": 1480,
1480
+ "92816": 1481,
1481
+ "92835": 1482,
1482
+ "93471": 1483,
1483
+ "93540": 1484,
1484
+ "94381": 1485,
1485
+ "94487": 1486,
1486
+ "94913": 1487,
1487
+ "95102": 1488,
1488
+ "95524": 1489,
1489
+ "95531": 1490,
1490
+ "95557": 1491,
1491
+ "95614": 1492,
1492
+ "95741": 1493,
1493
+ "95952": 1494,
1494
+ "95954": 1495,
1495
+ "96099": 1496,
1496
+ "96146": 1497,
1497
+ "96266": 1498,
1498
+ "96488": 1499,
1499
+ "96521": 1500,
1500
+ "96772": 1501,
1501
+ "96899": 1502,
1502
+ "97183": 1503,
1503
+ "97219": 1504,
1504
+ "97253": 1505,
1505
+ "97306": 1506,
1506
+ "97378": 1507,
1507
+ "97587": 1508,
1508
+ "97668": 1509,
1509
+ "97686": 1510,
1510
+ "97775": 1511,
1511
+ "97800": 1512,
1512
+ "97809": 1513,
1513
+ "97914": 1514,
1514
+ "97998": 1515,
1515
+ "98040": 1516,
1516
+ "98398": 1517,
1517
+ "98443": 1518,
1518
+ "98485": 1519,
1519
+ "98765": 1520,
1520
+ "98878": 1521,
1521
+ "99156": 1522,
1522
+ "99540": 1523,
1523
+ "99603": 1524,
1524
+ "99633": 1525,
1525
+ "99954": 1526,
1526
+ "99972": 1527,
1527
+ "100127": 1528,
1528
+ "<pad>": 0,
1529
+ "<sos>": 1,
1530
+ "<eos>": 2
1531
+ }
src/model/rellow-2.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a4a07540e4d12ec2919c9ae2004bc523efc5a27da9ec08c9945479a98a3e8e50
3
+ size 14227945
src/services/model.py ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import json
3
+ import torch
4
+ # from pathlib import Path
5
+ from services.transformer import TinyTransformer
6
+
7
+ # Internal constants for file paths
8
+ # _MODEL_DIR = os.path.join(os.path.dirname(os.path.dirname(__file__)), "model")
9
+ # _VOCAB_DIR = os.path.join(os.path.dirname(os.path.dirname(__file__)), "data")
10
+ _MODEL_PATH = os.path.join(os.path.dirname(os.path.dirname(__file__)), "model", "rellow-2.pt")
11
+ _VOCAB_PATH = os.path.join(os.path.dirname(os.path.dirname(__file__)), "data", "vocab.json")
12
+
13
+ # Internal device selection
14
+ _DEVICE = torch.device("mps" if torch.backends.mps.is_available() else "cpu")
15
+
16
+ # Save the model state and vocabulary to disk.
17
+ # def save_model(model, vocab):
18
+ # # Create necessary directories
19
+ # os.makedirs(_MODEL_DIR, exist_ok=True)
20
+ # os.makedirs(_VOCAB_DIR, exist_ok=True)
21
+
22
+ # # Save model state
23
+ # torch.save(model.state_dict(), _MODEL_PATH)
24
+
25
+ # # Save vocabulary
26
+ # with open(_VOCAB_PATH, "w", encoding="utf-8") as f:
27
+ # json.dump(vocab, f, ensure_ascii=False, indent=2)
28
+
29
+ # print(f"Model saved to {_MODEL_PATH}")
30
+ # print(f"Vocabulary saved to {_VOCAB_PATH}")
31
+
32
+ # Load the model and its vocabulary from disk.
33
+ def load_model():
34
+ # Load vocabulary
35
+ with open(_VOCAB_PATH, "r", encoding="utf-8") as f:
36
+ vocab = json.load(f)
37
+ inv_vocab = {int(v): k for k, v in vocab.items()}
38
+
39
+ # Initialize and load model
40
+ model = TinyTransformer(vocab_size=len(vocab)).to(_DEVICE)
41
+ model.load_state_dict(torch.load(_MODEL_PATH, map_location=_DEVICE))
42
+ model.eval()
43
+
44
+ return model, vocab, inv_vocab
45
+
46
+ # Get the device being used for model operations.
47
+ def get_device():
48
+ return _DEVICE
src/services/transformer.py ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ import torch.nn as nn
3
+ from constants.tokens import PAD_ID
4
+
5
+ class TinyTransformer(nn.Module):
6
+ def __init__(self, vocab_size, d_model=256, nhead=4, num_layers=2, dim_feedforward=512, dropout=0.1):
7
+ super().__init__()
8
+ self.embedding = nn.Embedding(vocab_size, d_model, padding_idx=PAD_ID)
9
+ self.pos_encoder = PositionalEncoding(d_model, dropout)
10
+ encoder_layer = nn.TransformerEncoderLayer(d_model, nhead, dim_feedforward, dropout, batch_first=True)
11
+ self.encoder = nn.TransformerEncoder(encoder_layer, num_layers=num_layers)
12
+ decoder_layer = nn.TransformerDecoderLayer(d_model, nhead, dim_feedforward, dropout, batch_first=True)
13
+ self.decoder = nn.TransformerDecoder(decoder_layer, num_layers=num_layers)
14
+ self.out = nn.Linear(d_model, vocab_size)
15
+
16
+ # Keep tensors in batch-first format
17
+ def forward(self, src, tgt):
18
+ tgt_mask = nn.Transformer.generate_square_subsequent_mask(tgt.size(1)).to(src.device).bool()
19
+ src_emb = self.pos_encoder(self.embedding(src))
20
+ tgt_emb = self.pos_encoder(self.embedding(tgt))
21
+ # Create padding masks
22
+ src_padding_mask = (src == PAD_ID).bool()
23
+ tgt_padding_mask = (tgt == PAD_ID).bool()
24
+ memory = self.encoder(src_emb, src_key_padding_mask=src_padding_mask)
25
+ output = self.decoder(tgt_emb, memory, tgt_mask=tgt_mask, tgt_key_padding_mask=tgt_padding_mask)
26
+ return self.out(output) # (batch, seq_len, vocab)
27
+
28
+ def generate_src_mask(self, size):
29
+ return torch.zeros((size, size), device='cpu').type(torch.bool)
30
+
31
+ class PositionalEncoding(nn.Module):
32
+ def __init__(self, d_model, dropout=0.1, max_len=512):
33
+ super().__init__()
34
+ self.dropout = nn.Dropout(p=dropout)
35
+ position = torch.arange(0, max_len).unsqueeze(1)
36
+ div_term = torch.exp(
37
+ torch.arange(0, d_model, 2) * (-torch.log(torch.tensor(10000.0)) / d_model)
38
+ )
39
+ pe = torch.zeros(max_len, d_model)
40
+ pe[:, 0::2] = torch.sin(position * div_term) # even indices
41
+ pe[:, 1::2] = torch.cos(position * div_term) # odd indices
42
+ self.register_buffer('pe', pe.unsqueeze(0))
43
+
44
+ def forward(self, x):
45
+ x = x + self.pe[:, :x.size(1), :].to(x.device)
46
+ return self.dropout(x)