Kevin Fink commited on
Commit
e32d4aa
·
1 Parent(s): ce52bdd
Files changed (3) hide show
  1. app.py +4 -8
  2. gradio-3.wpu +252 -252
  3. selenium_click.py +2 -2
app.py CHANGED
@@ -28,9 +28,8 @@ model_save_path = '/data/lora_finetuned_model' # Specify your desired save path
28
  model.save_pretrained(model_save_path)
29
  '''
30
 
31
- def fine_tune_model(dataset_name, hub_id, api_key, num_epochs, batch_size, lr, grad):
32
- try:
33
- model = AutoModelForSeq2SeqLM.from_pretrained("google/t5-efficient-tiny-nh8")
34
  torch.cuda.empty_cache()
35
  torch.nn.CrossEntropyLoss()
36
  #rouge_metric = evaluate.load("rouge", cache_dir='/data/cache')
@@ -301,10 +300,7 @@ def run_train(dataset_name, hub_id, api_key, num_epochs, batch_size, lr, grad):
301
  torch.nn.init.xavier_uniform_(param.data) # Xavier initialization
302
  elif 'encoder.block.0.layer.0.DenseReluDense.wo.weight' in name: # Another example layer
303
  torch.nn.init.kaiming_normal_(param.data) # Kaiming initialization
304
-
305
- config = AutoConfig.from_pretrained("google/t5-efficient-tiny-nh8")
306
- model = AutoModelForSeq2SeqLM.from_config(config)
307
- initialize_weights(model)
308
  lora_config = LoraConfig(
309
  r=4, # Rank of the low-rank adaptation
310
  lora_alpha=8, # Scaling factor
@@ -335,7 +331,7 @@ except Exception as e:
335
  # Create Gradio interface
336
  try:
337
  iface = gr.Interface(
338
- fn=fine_tune_model,
339
  inputs=[
340
  gr.Textbox(label="Dataset Name (e.g., 'imdb')"),
341
  gr.Textbox(label="HF hub to push to after training"),
 
28
  model.save_pretrained(model_save_path)
29
  '''
30
 
31
+ def fine_tune_model(model, dataset_name, hub_id, api_key, num_epochs, batch_size, lr, grad):
32
+ try:
 
33
  torch.cuda.empty_cache()
34
  torch.nn.CrossEntropyLoss()
35
  #rouge_metric = evaluate.load("rouge", cache_dir='/data/cache')
 
300
  torch.nn.init.xavier_uniform_(param.data) # Xavier initialization
301
  elif 'encoder.block.0.layer.0.DenseReluDense.wo.weight' in name: # Another example layer
302
  torch.nn.init.kaiming_normal_(param.data) # Kaiming initialization
303
+ model = AutoModelForSeq2SeqLM.from_pretrained("tarekziade/wikipedia-summaries-t5-efficient-tiny")
 
 
 
304
  lora_config = LoraConfig(
305
  r=4, # Rank of the low-rank adaptation
306
  lora_alpha=8, # Scaling factor
 
331
  # Create Gradio interface
332
  try:
333
  iface = gr.Interface(
334
+ fn=run_train,
335
  inputs=[
336
  gr.Textbox(label="Dataset Name (e.g., 'imdb')"),
337
  gr.Textbox(label="HF hub to push to after training"),
gradio-3.wpu CHANGED
@@ -326,7 +326,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
326
  'fRegexFlags': 42,
327
  'fReplaceText': 'add_knowledge_base_to_vector_store',
328
  'fReverse': False,
329
- 'fSearchText': 'lf.app.aupdate_stat',
330
  'fStartPos': 0,
331
  'fStyle': 'wildcard',
332
  'fWholeWords': False,
@@ -425,311 +425,290 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
425
  'wide',
426
  1,
427
  {})],
428
- 'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('../../envs/gradio-3/lib/python3.12/site-packages/transformers/pipelines/base.py'),
429
- {'attrib-starts': [('infer_framework_load_model|0|',
430
- 205)],
431
- 'code-line': ' raise RuntimeError(\n',
432
- 'first-line': 226,
433
  'folded-linenos': [],
434
- 'sel-line': 239,
435
- 'sel-line-start': 9148,
436
- 'selection_end': 9148,
437
- 'selection_start': 9148,
438
  'zoom': 0},
439
- 1733890299.157337],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
440
  [loc('selenium_click.py'),
441
- {'attrib-starts': [],
442
- 'code-line': 'def test(text): \n',
 
443
  'first-line': 0,
444
  'folded-linenos': [],
445
- 'sel-line': 2,
446
- 'sel-line-start': 35,
447
- 'selection_end': 50,
448
- 'selection_start': 50,
449
  'zoom': 0},
450
- 1733890425.432772],
451
  [loc('app.py'),
452
- {'attrib-starts': [('run_train|0|',
453
- 286)],
454
- 'code-line': ' config = AutoConfig.from_pretrained("google/t5-efficient-tiny-nh8")\n',
455
- 'first-line': 273,
456
- 'folded-linenos': [],
457
- 'sel-line': 294,
458
- 'sel-line-start': 13525,
459
- 'selection_end': 13594,
460
- 'selection_start': 13566,
461
- 'zoom': 0},
462
- 1733890482.8022997],
463
- [loc('selenium_click.py'),
464
- {'attrib-starts': [],
465
- 'code-line': 'def test(text): \n',
466
- 'first-line': 0,
467
  'folded-linenos': [],
468
- 'sel-line': 2,
469
- 'sel-line-start': 35,
470
- 'selection_end': 50,
471
- 'selection_start': 50,
472
  'zoom': 0},
473
- 1733890703.8402333],
474
  [loc('app.py'),
475
  {'attrib-starts': [('run_train|0|',
476
- 286)],
477
- 'code-line': ' lora_alpha=8, # Scaling factor\n',
478
- 'first-line': 285,
479
  'folded-linenos': [],
480
- 'sel-line': 299,
481
- 'sel-line-start': 13759,
482
- 'selection_end': 13779,
483
- 'selection_start': 13779,
484
  'zoom': 0},
485
- 1733890990.4531481],
486
  [loc('selenium_click.py'),
487
- {'attrib-starts': [],
488
- 'code-line': 'def test(text): \n',
 
489
  'first-line': 0,
490
  'folded-linenos': [],
491
- 'sel-line': 2,
492
- 'sel-line-start': 35,
493
- 'selection_end': 50,
494
- 'selection_start': 50,
495
  'zoom': 0},
496
- 1733890992.9117355],
497
- [loc('app.py'),
498
- {'attrib-starts': [('run_train|0|',
499
- 286)],
500
- 'code-line': ' lora_alpha=8, # Scaling factor\n',
501
- 'first-line': 285,
 
 
502
  'folded-linenos': [],
503
- 'sel-line': 299,
504
- 'sel-line-start': 13759,
505
- 'selection_end': 13779,
506
- 'selection_start': 13779,
507
  'zoom': 0},
508
- 1733891097.8497958],
509
- [loc('app.py'),
510
- {'attrib-starts': [('fine_tune_model|0|',
511
- 30)],
512
- 'code-line': " return 'TOKENS DONE'\n",
513
- 'first-line': 153,
514
  'folded-linenos': [],
515
- 'sel-line': 162,
516
- 'sel-line-start': 7058,
517
- 'selection_end': 7093,
518
- 'selection_start': 7093,
519
  'zoom': 0},
520
- 1733891492.4296558],
521
- [loc('app.py'),
522
- {'attrib-starts': [('fine_tune_model|0|',
523
- 30)],
524
- 'code-line': ' #greater_is_better=True,\n',
525
- 'first-line': 66,
526
  'folded-linenos': [],
527
- 'sel-line': 82,
528
- 'sel-line-start': 3317,
529
- 'selection_end': 3330,
530
- 'selection_start': 3330,
531
  'zoom': 0},
532
- 1733913275.840877],
533
  [loc('selenium_click.py'),
534
- {'attrib-starts': [],
535
- 'code-line': 'def test(text): \n',
 
536
  'first-line': 0,
537
  'folded-linenos': [],
538
- 'sel-line': 2,
539
- 'sel-line-start': 35,
540
- 'selection_end': 50,
541
- 'selection_start': 50,
542
  'zoom': 0},
543
- 1733913307.3307884],
544
- [loc('app.py'),
545
- {'attrib-starts': [('fine_tune_model|0|',
546
- 30)],
547
- 'code-line': ' #greater_is_better=True,\n',
548
- 'first-line': 66,
549
  'folded-linenos': [],
550
- 'sel-line': 82,
551
- 'sel-line-start': 3317,
552
- 'selection_end': 3330,
553
- 'selection_start': 3330,
554
  'zoom': 0},
555
- 1733913312.928603],
556
  [loc('app.py'),
557
  {'attrib-starts': [('run_train|0|',
558
- 286)],
559
- 'code-line': ' #model = get_peft_model(model, lora_config)\n',
560
- 'first-line': 289,
561
  'folded-linenos': [],
562
- 'sel-line': 303,
563
- 'sel-line-start': 13896,
564
- 'selection_end': 13901,
565
- 'selection_start': 13901,
566
  'zoom': 0},
567
- 1733913335.5815701],
568
- [loc('selenium_click.py'),
569
  {'attrib-starts': [],
570
- 'code-line': "pp(test(''' We generally recommend a DeepNarrow strategy where the model’s depth is preferentially increased before considering any other forms of uniform scaling across other dimensions. This is largely due to how much depth influences the Pareto-frontier as shown in earlier sections of the paper. Specifically, a tall small (deep and narrow) model is generally more efficient compared to the base model. Likewise, a tall base model might also generally more efficient compared to a large model. We generally find that, regardless of size, even if absolute performance might increase as we continue to stack layers, the relative gain of Pareto-efficiency diminishes as we increase the layers, converging at 32 to 36 layers. Finally, we note that our notion of efficiency here relates to any one compute dimension, i.e., params, FLOPs or throughput (speed). We report all three key efficiency metrics (number of params, FLOPS and speed) and leave this decision to the practitioner to decide which compute dimension to consi",
571
- 'first-line': 0,
572
  'folded-linenos': [],
573
- 'sel-line': 18,
574
- 'sel-line-start': 456,
575
- 'selection_end': 1486,
576
- 'selection_start': 1486,
577
  'zoom': 0},
578
- 1733913348.8564975],
579
- [loc('selenium_click.py'),
580
- {'attrib-starts': [('test|0|',
581
- 2)],
582
- 'code-line': ' ) \n',
583
- 'first-line': 0,
584
  'folded-linenos': [],
585
- 'sel-line': 10,
586
- 'sel-line-start': 309,
587
- 'selection_end': 322,
588
- 'selection_start': 322,
589
  'zoom': 0},
590
- 1733913374.2822852],
591
- [loc('../../envs/gradio-3/lib/python3.12/site-packages/torch/nn/modules/module.py'),
592
- {'attrib-starts': [('Module|0|',
593
- 398),
594
- ('Module|0|._call_impl|0|',
595
- 1739)],
596
- 'code-line': ' return forward_call(*args, **kwargs)\n',
597
- 'first-line': 1723,
598
  'folded-linenos': [],
599
- 'sel-line': 1746,
600
- 'sel-line-start': 69769,
601
- 'selection_end': 69769,
602
- 'selection_start': 69769,
603
  'zoom': 0},
604
- 1733913382.1839955],
605
- [loc('selenium_click.py'),
606
- {'attrib-starts': [('test|0|',
607
- 2)],
608
- 'code-line': " cache_dir='./cache',\n",
609
- 'first-line': 0,
610
  'folded-linenos': [],
611
- 'sel-line': 9,
612
- 'sel-line-start': 268,
613
- 'selection_end': 296,
614
- 'selection_start': 296,
615
  'zoom': 0},
616
- 1733913397.7313583],
617
- [loc('../../envs/gradio-3/lib/python3.12/site-packages/transformers/generation/utils.py'),
618
- {'attrib-starts': [('GenerationMixin|0|',
619
- 331),
620
- ('GenerationMixin|0|._validate_model_kwargs|0|',
621
- 1332)],
622
- 'code-line': ' raise ValueError(\n',
623
- 'first-line': 1364,
624
  'folded-linenos': [],
625
- 'sel-line': 1387,
626
- 'sel-line-start': 74204,
627
- 'selection_end': 74204,
628
- 'selection_start': 74204,
629
  'zoom': 0},
630
- 1733913398.4591272],
631
- [loc('../tidal_slides_com/src/ts_ai.py'),
632
- {'attrib-starts': [],
633
- 'code-line': '#kevin fink\n',
634
- 'first-line': 0,
 
635
  'folded-linenos': [],
636
- 'sel-line': 0,
637
- 'sel-line-start': 0,
638
- 'selection_end': 0,
639
- 'selection_start': 0,
640
  'zoom': 0},
641
- 1733913400.5161366],
642
- [loc('../tidal_slides_com/src/ts_main.py'),
643
- {'attrib-starts': [],
644
- 'code-line': '#kevin fink\n',
645
- 'first-line': 0,
 
646
  'folded-linenos': [],
647
- 'sel-line': 0,
648
- 'sel-line-start': 0,
649
- 'selection_end': 0,
650
- 'selection_start': 0,
651
  'zoom': 0},
652
- 1733913403.929367],
653
- [loc('../tidal_slides_com/src/ts_main.py'),
654
- {'attrib-starts': [('init_summarizer|0|',
655
- 81)],
656
- 'code-line': " model_kwargs={'cache_dir': summary_model_fp}\n",
657
- 'first-line': 81,
658
  'folded-linenos': [],
659
- 'sel-line': 87,
660
- 'sel-line-start': 2233,
661
- 'selection_end': 2285,
662
- 'selection_start': 2241,
663
  'zoom': 0},
664
- 1733913404.9677553]],
665
  20),
666
  'current-loc': loc('selenium_click.py'),
667
  'editor-state-list': [(loc('app.py'),
668
  {'attrib-starts': [('run_train|0|',
669
- 286)],
670
- 'code-line': ' #model = get_peft_model(model, lora_config)\n',
671
  'first-line': 289,
672
  'folded-linenos': [],
673
- 'sel-line': 303,
674
- 'sel-line-start': 13896,
675
- 'selection_end': 13901,
676
- 'selection_start': 13901,
 
 
 
 
 
 
 
 
 
 
 
677
  'zoom': 0}),
678
  (loc('selenium_click.py'),
679
  {'attrib-starts': [('test|0|',
680
  2)],
681
- 'code-line': " model_kwargs={'cache_dir': './cache'}\n",
682
- 'first-line': 0,
683
- 'folded-linenos': [],
684
- 'sel-line': 9,
685
- 'sel-line-start': 268,
686
- 'selection_end': 311,
687
- 'selection_start': 311,
688
- 'zoom': 0}),
689
- (loc('../tidal_slides_com/src/ts_ai.py'),
690
- {'attrib-starts': [],
691
- 'code-line': '#kevin fink\n',
692
  'first-line': 0,
693
  'folded-linenos': [],
694
- 'sel-line': 0,
695
- 'sel-line-start': 0,
696
- 'selection_end': 0,
697
- 'selection_start': 0,
698
- 'zoom': 0}),
699
- (loc('../tidal_slides_com/src/ts_main.py'),
700
- {'attrib-starts': [('init_summarizer|0|',
701
- 81)],
702
- 'code-line': " model_kwargs={'cache_dir': summary_model_fp}\n",
703
- 'first-line': 81,
704
- 'folded-linenos': [],
705
- 'sel-line': 87,
706
- 'sel-line-start': 2233,
707
- 'selection_end': 2285,
708
- 'selection_start': 2241,
709
- 'zoom': 0}),
710
- (loc('../../envs/gradio-3/lib/python3.12/site-packages/transformers/generation/utils.py'),
711
- {'attrib-starts': [('GenerationMixin|0|',
712
- 331),
713
- ('GenerationMixin|0|._validate_model_kwargs|0|',
714
- 1332)],
715
- 'code-line': ' raise ValueError(\n',
716
- 'first-line': 1364,
717
- 'folded-linenos': [],
718
- 'sel-line': 1387,
719
- 'sel-line-start': 74204,
720
- 'selection_end': 74204,
721
- 'selection_start': 74204,
722
  'zoom': 0})],
723
  'has-focus': True,
724
  'locked': False},
725
  [loc('app.py'),
726
- loc('selenium_click.py'),
727
- loc('../tidal_slides_com/src/ts_ai.py'),
728
- loc('../tidal_slides_com/src/ts_main.py'),
729
- loc('../../envs/gradio-3/lib/python3.12/site-packages/transformers/generation/utils.py')]),
730
  'open_files': ['app.py',
731
- '../tidal_slides_com/src/ts_ai.py',
732
- '../tidal_slides_com/src/ts_main.py',
733
  'selenium_click.py']},
734
  'saved_notebook_display': None,
735
  'split_percents': {0: 0.4410585404971933,
@@ -739,7 +718,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
739
  'tab_location': 'top',
740
  'traversal_pos': ((1,
741
  1),
742
- 1733913397.6458473),
743
  'user_data': {}},
744
  'saved_notebook_display': None,
745
  'split_percents': {0: 0.49743589743589745},
@@ -747,17 +726,15 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
747
  'tab_location': 'left',
748
  'traversal_pos': ((1,
749
  0),
750
- 1733913397.6374698),
751
  'user_data': {}},
752
  'window-alloc': (0,
753
  0,
754
  1920,
755
- 823)}]}
756
  guimgr.recent-documents = [loc('selenium_click.py'),
757
- loc('../tidal_slides_com/src/ts_main.py'),
758
- loc('../tidal_slides_com/src/ts_ai.py'),
759
- loc('../../envs/gradio-3/lib/python3.12/site-packages/transformers/generation/utils.py'),
760
- loc('app.py')]
761
  guimgr.visual-state = {loc('../../envs/gradio-3/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py'): {'attrib-starts': [('ErrorHandler|0|',
762
  140),
763
  ('ErrorHandler|0|.check_response|0|',
@@ -796,13 +773,35 @@ guimgr.visual-state = {loc('../../envs/gradio-3/lib/python3.12/site-packages/sel
796
  'zoom': 0},
797
  loc('../../envs/gradio-3/lib/python3.12/site-packages/transformers/pipelines/base.py'): {'attrib-starts': [('infer_framework_load_model|0|',
798
  205)],
799
- 'code-line': ' raise RuntimeError(\n',
800
- 'first-line': 226,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
801
  'folded-linenos': [],
802
- 'sel-line': 239,
803
- 'sel-line-start': 9148,
804
- 'selection_end': 9148,
805
- 'selection_start': 9148,
806
  'zoom': 0},
807
  loc('gradio-3.wpr'): {'attrib-starts': [],
808
  'code-line': '#!wing\n',
@@ -824,6 +823,7 @@ guimgr.visual-state = {loc('../../envs/gradio-3/lib/python3.12/site-packages/sel
824
  'zoom': 0}}
825
  proj.pyexec = {None: ('custom',
826
  '/home/kevin/envs/gradio-3/bin/python3')}
 
827
  testing.stored-results = (1,
828
  [],
829
  {})
 
326
  'fRegexFlags': 42,
327
  'fReplaceText': 'add_knowledge_base_to_vector_store',
328
  'fReverse': False,
329
+ 'fSearchText': 'readme',
330
  'fStartPos': 0,
331
  'fStyle': 'wildcard',
332
  'fWholeWords': False,
 
425
  'wide',
426
  1,
427
  {})],
428
+ 'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('selenium_click.py'),
429
+ {'attrib-starts': [('test|0|',
430
+ 2)],
431
+ 'code-line': " model_name = 'Baicai003/tiny-t5'\n",
432
+ 'first-line': 0,
433
  'folded-linenos': [],
434
+ 'sel-line': 3,
435
+ 'sel-line-start': 55,
436
+ 'selection_end': 90,
437
+ 'selection_start': 90,
438
  'zoom': 0},
439
+ 1733969719.994683],
440
+ [loc('../../envs/gradio-3/lib/python3.12/site-packages/transformers/tokenization_utils_base.py'),
441
+ {'attrib-starts': [('PreTrainedTokenizerBase|0|',
442
+ 1379),
443
+ ('PreTrainedTokenizerBase|0|.from_pretrained|0|',
444
+ 1794)],
445
+ 'code-line': ' raise EnvironmentError(\n',
446
+ 'first-line': 1991,
447
+ 'folded-linenos': [],
448
+ 'sel-line': 2015,
449
+ 'sel-line-start': 101653,
450
+ 'selection_end': 101653,
451
+ 'selection_start': 101653,
452
+ 'zoom': 0},
453
+ 1733969734.6770854],
454
  [loc('selenium_click.py'),
455
+ {'attrib-starts': [('test|0|',
456
+ 2)],
457
+ 'code-line': " model_name = 'Baicai003/tiny-t5'\n",
458
  'first-line': 0,
459
  'folded-linenos': [],
460
+ 'sel-line': 3,
461
+ 'sel-line-start': 55,
462
+ 'selection_end': 91,
463
+ 'selection_start': 91,
464
  'zoom': 0},
465
+ 1733969741.5539677],
466
  [loc('app.py'),
467
+ {'attrib-starts': [('fine_tune_model|0|',
468
+ 30)],
469
+ 'code-line': ' model = AutoModelForSeq2SeqLM.from_pretrained("google/t5-efficient-tiny-nh8")\n',
470
+ 'first-line': 241,
 
 
 
 
 
 
 
 
 
 
 
471
  'folded-linenos': [],
472
+ 'sel-line': 32,
473
+ 'sel-line-start': 1129,
474
+ 'selection_end': 1213,
475
+ 'selection_start': 1213,
476
  'zoom': 0},
477
+ 1733969749.87093],
478
  [loc('app.py'),
479
  {'attrib-starts': [('run_train|0|',
480
+ 296)],
481
+ 'code-line': ' config = AutoConfig.from_pretrained("google/t5-efficient-tiny-nh8")\n',
482
+ 'first-line': 298,
483
  'folded-linenos': [],
484
+ 'sel-line': 304,
485
+ 'sel-line-start': 13927,
486
+ 'selection_end': 13996,
487
+ 'selection_start': 13968,
488
  'zoom': 0},
489
+ 1733969751.1447525],
490
  [loc('selenium_click.py'),
491
+ {'attrib-starts': [('test|0|',
492
+ 2)],
493
+ 'code-line': " model_name = 'huseinzol05/abstractive-summarization-v2-tiny-t5-quantized'\n",
494
  'first-line': 0,
495
  'folded-linenos': [],
496
+ 'sel-line': 3,
497
+ 'sel-line-start': 55,
498
+ 'selection_end': 131,
499
+ 'selection_start': 131,
500
  'zoom': 0},
501
+ 1733970908.1719747],
502
+ [loc('../../envs/gradio-3/lib/python3.12/site-packages/transformers/tokenization_utils_base.py'),
503
+ {'attrib-starts': [('PreTrainedTokenizerBase|0|',
504
+ 1379),
505
+ ('PreTrainedTokenizerBase|0|.from_pretrained|0|',
506
+ 1794)],
507
+ 'code-line': ' raise EnvironmentError(\n',
508
+ 'first-line': 2001,
509
  'folded-linenos': [],
510
+ 'sel-line': 2015,
511
+ 'sel-line-start': 101653,
512
+ 'selection_end': 101653,
513
+ 'selection_start': 101653,
514
  'zoom': 0},
515
+ 1733970913.9058852],
516
+ [loc('selenium_click.py'),
517
+ {'attrib-starts': [('test|0|',
518
+ 2)],
519
+ 'code-line': " tokenizer='google/t5-efficient-tiny',\n",
520
+ 'first-line': 0,
521
  'folded-linenos': [],
522
+ 'sel-line': 7,
523
+ 'sel-line-start': 211,
524
+ 'selection_end': 254,
525
+ 'selection_start': 254,
526
  'zoom': 0},
527
+ 1733970939.6640677],
528
+ [loc('../../envs/gradio-3/lib/python3.12/site-packages/transformers/pipelines/base.py'),
529
+ {'attrib-starts': [('infer_framework_load_model|0|',
530
+ 205)],
531
+ 'code-line': ' raise ValueError(\n',
532
+ 'first-line': 279,
533
  'folded-linenos': [],
534
+ 'sel-line': 301,
535
+ 'sel-line-start': 12058,
536
+ 'selection_end': 12058,
537
+ 'selection_start': 12058,
538
  'zoom': 0},
539
+ 1733970951.1496227],
540
  [loc('selenium_click.py'),
541
+ {'attrib-starts': [('test|0|',
542
+ 2)],
543
+ 'code-line': " model_name = 'tarekziade/wikipedia-summaries-t5-efficient-tiny'\n",
544
  'first-line': 0,
545
  'folded-linenos': [],
546
+ 'sel-line': 3,
547
+ 'sel-line-start': 55,
548
+ 'selection_end': 121,
549
+ 'selection_start': 73,
550
  'zoom': 0},
551
+ 1733971918.209765],
552
+ [loc('../../envs/gradio-3/lib/python3.12/site-packages/transformers/pipelines/base.py'),
553
+ {'attrib-starts': [('infer_framework_load_model|0|',
554
+ 205)],
555
+ 'code-line': ' raise ValueError(\n',
556
+ 'first-line': 279,
557
  'folded-linenos': [],
558
+ 'sel-line': 301,
559
+ 'sel-line-start': 12058,
560
+ 'selection_end': 12058,
561
+ 'selection_start': 12058,
562
  'zoom': 0},
563
+ 1733971919.070313],
564
  [loc('app.py'),
565
  {'attrib-starts': [('run_train|0|',
566
+ 296)],
567
+ 'code-line': ' config = AutoConfig.from_pretrained("google/t5-efficient-tiny-nh8")\n',
568
+ 'first-line': 298,
569
  'folded-linenos': [],
570
+ 'sel-line': 304,
571
+ 'sel-line-start': 13927,
572
+ 'selection_end': 13996,
573
+ 'selection_start': 13968,
574
  'zoom': 0},
575
+ 1733971926.4038842],
576
+ [loc('app.py'),
577
  {'attrib-starts': [],
578
+ 'code-line': 'def fine_tune_model(model, dataset_name, hub_id, api_key, num_epochs, batch_size, lr, grad):\n',
579
+ 'first-line': 21,
580
  'folded-linenos': [],
581
+ 'sel-line': 30,
582
+ 'sel-line-start': 1034,
583
+ 'selection_end': 1061,
584
+ 'selection_start': 1061,
585
  'zoom': 0},
586
+ 1733971946.8028426],
587
+ [loc('app.py'),
588
+ {'attrib-starts': [('run_train|0|',
589
+ 295)],
590
+ 'code-line': ' model = AutoModelForSeq2SeqLM.from_pretrained("tarekziade/wikipedia-summaries-t5-efficient-tiny")\n',
591
+ 'first-line': 295,
592
  'folded-linenos': [],
593
+ 'sel-line': 303,
594
+ 'sel-line-start': 13856,
595
+ 'selection_end': 13897,
596
+ 'selection_start': 13897,
597
  'zoom': 0},
598
+ 1733971973.3178246],
599
+ [loc('app.py'),
600
+ {'attrib-starts': [('fine_tune_model|0|',
601
+ 30)],
602
+ 'code-line': " tokenizer = AutoTokenizer.from_pretrained('google/t5-efficient-tiny', use_fast=True, trust_remote_code=True)\n",
603
+ 'first-line': 89,
 
 
604
  'folded-linenos': [],
605
+ 'sel-line': 96,
606
+ 'sel-line-start': 3967,
607
+ 'selection_end': 4042,
608
+ 'selection_start': 4042,
609
  'zoom': 0},
610
+ 1733971982.8726587],
611
+ [loc('app.py'),
612
+ {'attrib-starts': [('fine_tune_model|0|',
613
+ 30)],
614
+ 'code-line': " tokenizer = AutoTokenizer.from_pretrained('google/t5-efficient-tiny', use_fast=True, trust_remote_code=True)\n",
615
+ 'first-line': 130,
616
  'folded-linenos': [],
617
+ 'sel-line': 96,
618
+ 'sel-line-start': 3967,
619
+ 'selection_end': 4042,
620
+ 'selection_start': 4042,
621
  'zoom': 0},
622
+ 1733971990.8933518],
623
+ [loc('app.py'),
624
+ {'attrib-starts': [('fine_tune_model|0|',
625
+ 30)],
626
+ 'code-line': " tokenizer = AutoTokenizer.from_pretrained('google/t5-efficient-tiny-nh8', use_fast=True, trust_remote_code=True)\n",
627
+ 'first-line': 256,
 
 
628
  'folded-linenos': [],
629
+ 'sel-line': 97,
630
+ 'sel-line-start': 4038,
631
+ 'selection_end': 4042,
632
+ 'selection_start': 4042,
633
  'zoom': 0},
634
+ 1733972563.3713217],
635
+ [loc('app.py'),
636
+ {'attrib-starts': [('run_train|0|',
637
+ 296)],
638
+ 'code-line': ' #model = get_peft_model(model, lora_config)\n',
639
+ 'first-line': 292,
640
  'folded-linenos': [],
641
+ 'sel-line': 313,
642
+ 'sel-line-start': 14297,
643
+ 'selection_end': 14344,
644
+ 'selection_start': 14344,
645
  'zoom': 0},
646
+ 1733972569.8712249],
647
+ [loc('app.py'),
648
+ {'attrib-starts': [('fine_tune_model|0|',
649
+ 30)],
650
+ 'code-line': ' try: \n',
651
+ 'first-line': 28,
652
  'folded-linenos': [],
653
+ 'sel-line': 31,
654
+ 'sel-line-start': 1120,
655
+ 'selection_end': 1128,
656
+ 'selection_start': 1128,
657
  'zoom': 0},
658
+ 1733972581.3592975],
659
+ [loc('app.py'),
660
+ {'attrib-starts': [('run_train|0|',
661
+ 295)],
662
+ 'code-line': ' model = AutoModelForSeq2SeqLM.from_pretrained("google/t5-efficient-tiny-nh8")\n',
663
+ 'first-line': 289,
664
  'folded-linenos': [],
665
+ 'sel-line': 304,
666
+ 'sel-line-start': 13921,
667
+ 'selection_end': 14002,
668
+ 'selection_start': 14002,
669
  'zoom': 0},
670
+ 1733972584.572358]],
671
  20),
672
  'current-loc': loc('selenium_click.py'),
673
  'editor-state-list': [(loc('app.py'),
674
  {'attrib-starts': [('run_train|0|',
675
+ 295)],
676
+ 'code-line': ' model = AutoModelForSeq2SeqLM.from_pretrained("google/t5-efficient-tiny-nh8")\n',
677
  'first-line': 289,
678
  'folded-linenos': [],
679
+ 'sel-line': 304,
680
+ 'sel-line-start': 13921,
681
+ 'selection_end': 14002,
682
+ 'selection_start': 14002,
683
+ 'zoom': 0}),
684
+ (loc('../../envs/gradio-3/lib/python3.12/site-packages/transformers/pipelines/base.py'),
685
+ {'attrib-starts': [('infer_framework_load_model|0|',
686
+ 205)],
687
+ 'code-line': ' raise ValueError(\n',
688
+ 'first-line': 279,
689
+ 'folded-linenos': [],
690
+ 'sel-line': 301,
691
+ 'sel-line-start': 12058,
692
+ 'selection_end': 12058,
693
+ 'selection_start': 12058,
694
  'zoom': 0}),
695
  (loc('selenium_click.py'),
696
  {'attrib-starts': [('test|0|',
697
  2)],
698
+ 'code-line': ' model=model_name,\n',
 
 
 
 
 
 
 
 
 
 
699
  'first-line': 0,
700
  'folded-linenos': [],
701
+ 'sel-line': 6,
702
+ 'sel-line-start': 175,
703
+ 'selection_end': 200,
704
+ 'selection_start': 200,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
705
  'zoom': 0})],
706
  'has-focus': True,
707
  'locked': False},
708
  [loc('app.py'),
709
+ loc('../../envs/gradio-3/lib/python3.12/site-packages/transformers/pipelines/base.py'),
710
+ loc('selenium_click.py')]),
 
 
711
  'open_files': ['app.py',
 
 
712
  'selenium_click.py']},
713
  'saved_notebook_display': None,
714
  'split_percents': {0: 0.4410585404971933,
 
718
  'tab_location': 'top',
719
  'traversal_pos': ((1,
720
  1),
721
+ 1733970939.6550887),
722
  'user_data': {}},
723
  'saved_notebook_display': None,
724
  'split_percents': {0: 0.49743589743589745},
 
726
  'tab_location': 'left',
727
  'traversal_pos': ((1,
728
  0),
729
+ 1733971910.3712847),
730
  'user_data': {}},
731
  'window-alloc': (0,
732
  0,
733
  1920,
734
+ 838)}]}
735
  guimgr.recent-documents = [loc('selenium_click.py'),
736
+ loc('app.py'),
737
+ loc('../../envs/gradio-3/lib/python3.12/site-packages/transformers/pipelines/base.py')]
 
 
738
  guimgr.visual-state = {loc('../../envs/gradio-3/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py'): {'attrib-starts': [('ErrorHandler|0|',
739
  140),
740
  ('ErrorHandler|0|.check_response|0|',
 
773
  'zoom': 0},
774
  loc('../../envs/gradio-3/lib/python3.12/site-packages/transformers/pipelines/base.py'): {'attrib-starts': [('infer_framework_load_model|0|',
775
  205)],
776
+ 'code-line': ' raise ValueError(\n',
777
+ 'first-line': 277,
778
+ 'folded-linenos': [],
779
+ 'sel-line': 301,
780
+ 'sel-line-start': 12058,
781
+ 'selection_end': 12058,
782
+ 'selection_start': 12058,
783
+ 'zoom': 0},
784
+ loc('../../envs/gradio-3/lib/python3.12/site-packages/transformers/tokenization_utils_base.py'): {'attrib-starts': [('PreTrainedTokenizerBase|0|',
785
+ 1379),
786
+ ('PreTrainedTokenizerBase|0|.from_pretrained|0|',
787
+ 1794)],
788
+ 'code-line': ' raise EnvironmentError(\n',
789
+ 'first-line': 2001,
790
+ 'folded-linenos': [],
791
+ 'sel-line': 2015,
792
+ 'sel-line-start': 101653,
793
+ 'selection_end': 101653,
794
+ 'selection_start': 101653,
795
+ 'zoom': 0},
796
+ loc('../tidal_slides_com/src/ts_main.py'): {'attrib-starts': [('init_summarizer|0|',
797
+ 81)],
798
+ 'code-line': " model_kwargs={'cache_dir': summary_model_fp}\n",
799
+ 'first-line': 81,
800
  'folded-linenos': [],
801
+ 'sel-line': 87,
802
+ 'sel-line-start': 2233,
803
+ 'selection_end': 2285,
804
+ 'selection_start': 2241,
805
  'zoom': 0},
806
  loc('gradio-3.wpr'): {'attrib-starts': [],
807
  'code-line': '#!wing\n',
 
823
  'zoom': 0}}
824
  proj.pyexec = {None: ('custom',
825
  '/home/kevin/envs/gradio-3/bin/python3')}
826
+ search.search-history = ['readme']
827
  testing.stored-results = (1,
828
  [],
829
  {})
selenium_click.py CHANGED
@@ -1,11 +1,11 @@
1
  from transformers import pipeline
2
 
3
  def test(text):
4
- model_name = 'shorecode/t5-efficient-tiny-nh8-summarizer'
5
  summarizer = pipeline(
6
  "summarization",
7
  model=model_name,
8
- tokenizer=model_name,
9
  clean_up_tokenization_spaces=True,
10
  model_kwargs={'cache_dir': './cache'}
11
  )
 
1
  from transformers import pipeline
2
 
3
  def test(text):
4
+ model_name = 'tarekziade/wikipedia-summaries-t5-efficient-tiny'
5
  summarizer = pipeline(
6
  "summarization",
7
  model=model_name,
8
+ tokenizer='google/t5-efficient-tiny',
9
  clean_up_tokenization_spaces=True,
10
  model_kwargs={'cache_dir': './cache'}
11
  )