Kevin Fink commited on
Commit
138f67f
·
1 Parent(s): be630f0
Files changed (3) hide show
  1. app.py +13 -0
  2. gradio-3.wpu +252 -0
  3. selenium_click.py +10 -1
app.py CHANGED
@@ -241,6 +241,19 @@ def fine_tune_model(model, dataset_name, hub_id, api_key, num_epochs, batch_size
241
  int_index = s.find('-')
242
  return int(s[int_index+1:])
243
 
 
 
 
 
 
 
 
 
 
 
 
 
 
244
  try:
245
  train_result = trainer.train(resume_from_checkpoint=True)
246
  except Exception as e:
 
241
  int_index = s.find('-')
242
  return int(s[int_index+1:])
243
 
244
+ <<<<<<< HEAD
245
+ =======
246
+ checkpoint_dir = training_args.output_dir
247
+ # If the trainer_state.json is missing, look for the previous checkpoint
248
+ previous_checkpoints = sorted(os.listdir("/data/results"), key=get_checkpoint_int, reverse=True)
249
+ print(f'CHECKPOINTs: {previous_checkpoints}')
250
+ for check in previous_checkpoints:
251
+ try:
252
+ print(f"Removing previous checkpoint {check}")
253
+ shutil.rmtree(os.path.join('/data/results', check))
254
+ except:
255
+ pass
256
+ >>>>>>> 35c5766 (dev)
257
  try:
258
  train_result = trainer.train(resume_from_checkpoint=True)
259
  except Exception as e:
gradio-3.wpu CHANGED
@@ -272,7 +272,11 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
272
  'primary_view_state': {'area': 'wide',
273
  'constraint': None,
274
  'current_pages': [2,
 
275
  2],
 
 
 
276
  'notebook_display': 'normal',
277
  'notebook_percent': 0.28547008547008546,
278
  'override_title': None,
@@ -425,6 +429,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
425
  'wide',
426
  1,
427
  {})],
 
428
  'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('app.py'),
429
  {'attrib-starts': [],
430
  'code-line': 'except Exception as e:\n',
@@ -559,6 +564,20 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
559
  'selection_start': 9148,
560
  'zoom': 0},
561
  1733890299.157337],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
562
  [loc('selenium_click.py'),
563
  {'attrib-starts': [],
564
  'code-line': 'def test(text): \n',
@@ -651,6 +670,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
651
  'selection_end': 3330,
652
  'selection_start': 3330,
653
  'zoom': 0},
 
654
  1733913275.840877]],
655
  20),
656
  'current-loc': loc('selenium_click.py'),
@@ -674,12 +694,214 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
674
  'sel-line-start': 35,
675
  'selection_end': 50,
676
  'selection_start': 50,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
677
  'zoom': 0})],
678
  'has-focus': True,
679
  'locked': False},
680
  [loc('app.py'),
 
681
  loc('selenium_click.py')]),
682
  'open_files': ['app.py',
 
 
 
 
 
 
 
 
 
683
  'selenium_click.py']},
684
  'saved_notebook_display': None,
685
  'split_percents': {0: 0.4410585404971933,
@@ -688,8 +910,13 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
688
  'splits': 2,
689
  'tab_location': 'top',
690
  'traversal_pos': ((1,
 
691
  2),
692
  1733890264.8827372),
 
 
 
 
693
  'user_data': {}},
694
  'saved_notebook_display': None,
695
  'split_percents': {0: 0.49743589743589745},
@@ -697,13 +924,23 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
697
  'tab_location': 'left',
698
  'traversal_pos': ((1,
699
  0),
 
700
  1733890676.3558738),
 
 
 
701
  'user_data': {}},
702
  'window-alloc': (0,
703
  0,
704
  1920,
705
  823)}]}
706
  guimgr.recent-documents = [loc('selenium_click.py'),
 
 
 
 
 
 
707
  loc('app.py')]
708
  guimgr.visual-state = {loc('../../envs/gradio-3/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py'): {'attrib-starts': [('ErrorHandler|0|',
709
  140),
@@ -729,6 +966,21 @@ guimgr.visual-state = {loc('../../envs/gradio-3/lib/python3.12/site-packages/sel
729
  'selection_end': 4266,
730
  'selection_start': 4266,
731
  'zoom': 0},
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
732
  loc('../../envs/gradio-3/lib/python3.12/site-packages/transformers/pipelines/base.py'): {'attrib-starts': [('infer_framework_load_model|0|',
733
  205)],
734
  'code-line': ' raise RuntimeError(\n',
 
272
  'primary_view_state': {'area': 'wide',
273
  'constraint': None,
274
  'current_pages': [2,
275
+ <<<<<<< HEAD
276
  2],
277
+ =======
278
+ 1],
279
+ >>>>>>> 35c5766 (dev)
280
  'notebook_display': 'normal',
281
  'notebook_percent': 0.28547008547008546,
282
  'override_title': None,
 
429
  'wide',
430
  1,
431
  {})],
432
+ <<<<<<< HEAD
433
  'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('app.py'),
434
  {'attrib-starts': [],
435
  'code-line': 'except Exception as e:\n',
 
564
  'selection_start': 9148,
565
  'zoom': 0},
566
  1733890299.157337],
567
+ =======
568
+ 'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('../../envs/gradio-3/lib/python3.12/site-packages/transformers/pipelines/base.py'),
569
+ {'attrib-starts': [('infer_framework_load_model|0|',
570
+ 205)],
571
+ 'code-line': ' raise RuntimeError(\n',
572
+ 'first-line': 226,
573
+ 'folded-linenos': [],
574
+ 'sel-line': 239,
575
+ 'sel-line-start': 9148,
576
+ 'selection_end': 9148,
577
+ 'selection_start': 9148,
578
+ 'zoom': 0},
579
+ 1733890299.157337],
580
+ >>>>>>> 35c5766 (dev)
581
  [loc('selenium_click.py'),
582
  {'attrib-starts': [],
583
  'code-line': 'def test(text): \n',
 
670
  'selection_end': 3330,
671
  'selection_start': 3330,
672
  'zoom': 0},
673
+ <<<<<<< HEAD
674
  1733913275.840877]],
675
  20),
676
  'current-loc': loc('selenium_click.py'),
 
694
  'sel-line-start': 35,
695
  'selection_end': 50,
696
  'selection_start': 50,
697
+ =======
698
+ 1733913275.840877],
699
+ [loc('selenium_click.py'),
700
+ {'attrib-starts': [],
701
+ 'code-line': 'def test(text): \n',
702
+ 'first-line': 0,
703
+ 'folded-linenos': [],
704
+ 'sel-line': 2,
705
+ 'sel-line-start': 35,
706
+ 'selection_end': 50,
707
+ 'selection_start': 50,
708
+ 'zoom': 0},
709
+ 1733913307.3307884],
710
+ [loc('app.py'),
711
+ {'attrib-starts': [('fine_tune_model|0|',
712
+ 30)],
713
+ 'code-line': ' #greater_is_better=True,\n',
714
+ 'first-line': 66,
715
+ 'folded-linenos': [],
716
+ 'sel-line': 82,
717
+ 'sel-line-start': 3317,
718
+ 'selection_end': 3330,
719
+ 'selection_start': 3330,
720
+ 'zoom': 0},
721
+ 1733913312.928603],
722
+ [loc('app.py'),
723
+ {'attrib-starts': [('run_train|0|',
724
+ 286)],
725
+ 'code-line': ' #model = get_peft_model(model, lora_config)\n',
726
+ 'first-line': 289,
727
+ 'folded-linenos': [],
728
+ 'sel-line': 303,
729
+ 'sel-line-start': 13896,
730
+ 'selection_end': 13901,
731
+ 'selection_start': 13901,
732
+ 'zoom': 0},
733
+ 1733913335.5815701],
734
+ [loc('selenium_click.py'),
735
+ {'attrib-starts': [],
736
+ '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",
737
+ 'first-line': 0,
738
+ 'folded-linenos': [],
739
+ 'sel-line': 18,
740
+ 'sel-line-start': 456,
741
+ 'selection_end': 1486,
742
+ 'selection_start': 1486,
743
+ 'zoom': 0},
744
+ 1733913348.8564975],
745
+ [loc('selenium_click.py'),
746
+ {'attrib-starts': [('test|0|',
747
+ 2)],
748
+ 'code-line': ' ) \n',
749
+ 'first-line': 0,
750
+ 'folded-linenos': [],
751
+ 'sel-line': 10,
752
+ 'sel-line-start': 309,
753
+ 'selection_end': 322,
754
+ 'selection_start': 322,
755
+ 'zoom': 0},
756
+ 1733913374.2822852],
757
+ [loc('../../envs/gradio-3/lib/python3.12/site-packages/torch/nn/modules/module.py'),
758
+ {'attrib-starts': [('Module|0|',
759
+ 398),
760
+ ('Module|0|._call_impl|0|',
761
+ 1739)],
762
+ 'code-line': ' return forward_call(*args, **kwargs)\n',
763
+ 'first-line': 1723,
764
+ 'folded-linenos': [],
765
+ 'sel-line': 1746,
766
+ 'sel-line-start': 69769,
767
+ 'selection_end': 69769,
768
+ 'selection_start': 69769,
769
+ 'zoom': 0},
770
+ 1733913382.1839955],
771
+ [loc('selenium_click.py'),
772
+ {'attrib-starts': [('test|0|',
773
+ 2)],
774
+ 'code-line': " cache_dir='./cache',\n",
775
+ 'first-line': 0,
776
+ 'folded-linenos': [],
777
+ 'sel-line': 9,
778
+ 'sel-line-start': 268,
779
+ 'selection_end': 296,
780
+ 'selection_start': 296,
781
+ 'zoom': 0},
782
+ 1733913397.7313583],
783
+ [loc('../../envs/gradio-3/lib/python3.12/site-packages/transformers/generation/utils.py'),
784
+ {'attrib-starts': [('GenerationMixin|0|',
785
+ 331),
786
+ ('GenerationMixin|0|._validate_model_kwargs|0|',
787
+ 1332)],
788
+ 'code-line': ' raise ValueError(\n',
789
+ 'first-line': 1364,
790
+ 'folded-linenos': [],
791
+ 'sel-line': 1387,
792
+ 'sel-line-start': 74204,
793
+ 'selection_end': 74204,
794
+ 'selection_start': 74204,
795
+ 'zoom': 0},
796
+ 1733913398.4591272],
797
+ [loc('../tidal_slides_com/src/ts_ai.py'),
798
+ {'attrib-starts': [],
799
+ 'code-line': '#kevin fink\n',
800
+ 'first-line': 0,
801
+ 'folded-linenos': [],
802
+ 'sel-line': 0,
803
+ 'sel-line-start': 0,
804
+ 'selection_end': 0,
805
+ 'selection_start': 0,
806
+ 'zoom': 0},
807
+ 1733913400.5161366],
808
+ [loc('../tidal_slides_com/src/ts_main.py'),
809
+ {'attrib-starts': [],
810
+ 'code-line': '#kevin fink\n',
811
+ 'first-line': 0,
812
+ 'folded-linenos': [],
813
+ 'sel-line': 0,
814
+ 'sel-line-start': 0,
815
+ 'selection_end': 0,
816
+ 'selection_start': 0,
817
+ 'zoom': 0},
818
+ 1733913403.929367],
819
+ [loc('../tidal_slides_com/src/ts_main.py'),
820
+ {'attrib-starts': [('init_summarizer|0|',
821
+ 81)],
822
+ 'code-line': " model_kwargs={'cache_dir': summary_model_fp}\n",
823
+ 'first-line': 81,
824
+ 'folded-linenos': [],
825
+ 'sel-line': 87,
826
+ 'sel-line-start': 2233,
827
+ 'selection_end': 2285,
828
+ 'selection_start': 2241,
829
+ 'zoom': 0},
830
+ 1733913404.9677553]],
831
+ 20),
832
+ 'current-loc': loc('selenium_click.py'),
833
+ 'editor-state-list': [(loc('app.py'),
834
+ {'attrib-starts': [('run_train|0|',
835
+ 286)],
836
+ 'code-line': ' #model = get_peft_model(model, lora_config)\n',
837
+ 'first-line': 289,
838
+ 'folded-linenos': [],
839
+ 'sel-line': 303,
840
+ 'sel-line-start': 13896,
841
+ 'selection_end': 13901,
842
+ 'selection_start': 13901,
843
+ 'zoom': 0}),
844
+ (loc('selenium_click.py'),
845
+ {'attrib-starts': [('test|0|',
846
+ 2)],
847
+ 'code-line': " model_kwargs={'cache_dir': './cache'}\n",
848
+ 'first-line': 0,
849
+ 'folded-linenos': [],
850
+ 'sel-line': 9,
851
+ 'sel-line-start': 268,
852
+ 'selection_end': 311,
853
+ 'selection_start': 311,
854
+ 'zoom': 0}),
855
+ (loc('../tidal_slides_com/src/ts_ai.py'),
856
+ {'attrib-starts': [],
857
+ 'code-line': '#kevin fink\n',
858
+ 'first-line': 0,
859
+ 'folded-linenos': [],
860
+ 'sel-line': 0,
861
+ 'sel-line-start': 0,
862
+ 'selection_end': 0,
863
+ 'selection_start': 0,
864
+ 'zoom': 0}),
865
+ (loc('../tidal_slides_com/src/ts_main.py'),
866
+ {'attrib-starts': [('init_summarizer|0|',
867
+ 81)],
868
+ 'code-line': " model_kwargs={'cache_dir': summary_model_fp}\n",
869
+ 'first-line': 81,
870
+ 'folded-linenos': [],
871
+ 'sel-line': 87,
872
+ 'sel-line-start': 2233,
873
+ 'selection_end': 2285,
874
+ 'selection_start': 2241,
875
+ 'zoom': 0}),
876
+ (loc('../../envs/gradio-3/lib/python3.12/site-packages/transformers/generation/utils.py'),
877
+ {'attrib-starts': [('GenerationMixin|0|',
878
+ 331),
879
+ ('GenerationMixin|0|._validate_model_kwargs|0|',
880
+ 1332)],
881
+ 'code-line': ' raise ValueError(\n',
882
+ 'first-line': 1364,
883
+ 'folded-linenos': [],
884
+ 'sel-line': 1387,
885
+ 'sel-line-start': 74204,
886
+ 'selection_end': 74204,
887
+ 'selection_start': 74204,
888
+ >>>>>>> 35c5766 (dev)
889
  'zoom': 0})],
890
  'has-focus': True,
891
  'locked': False},
892
  [loc('app.py'),
893
+ <<<<<<< HEAD
894
  loc('selenium_click.py')]),
895
  'open_files': ['app.py',
896
+ =======
897
+ loc('selenium_click.py'),
898
+ loc('../tidal_slides_com/src/ts_ai.py'),
899
+ loc('../tidal_slides_com/src/ts_main.py'),
900
+ loc('../../envs/gradio-3/lib/python3.12/site-packages/transformers/generation/utils.py')]),
901
+ 'open_files': ['app.py',
902
+ '../tidal_slides_com/src/ts_ai.py',
903
+ '../tidal_slides_com/src/ts_main.py',
904
+ >>>>>>> 35c5766 (dev)
905
  'selenium_click.py']},
906
  'saved_notebook_display': None,
907
  'split_percents': {0: 0.4410585404971933,
 
910
  'splits': 2,
911
  'tab_location': 'top',
912
  'traversal_pos': ((1,
913
+ <<<<<<< HEAD
914
  2),
915
  1733890264.8827372),
916
+ =======
917
+ 1),
918
+ 1733913397.6458473),
919
+ >>>>>>> 35c5766 (dev)
920
  'user_data': {}},
921
  'saved_notebook_display': None,
922
  'split_percents': {0: 0.49743589743589745},
 
924
  'tab_location': 'left',
925
  'traversal_pos': ((1,
926
  0),
927
+ <<<<<<< HEAD
928
  1733890676.3558738),
929
+ =======
930
+ 1733913397.6374698),
931
+ >>>>>>> 35c5766 (dev)
932
  'user_data': {}},
933
  'window-alloc': (0,
934
  0,
935
  1920,
936
  823)}]}
937
  guimgr.recent-documents = [loc('selenium_click.py'),
938
+ <<<<<<< HEAD
939
+ =======
940
+ loc('../tidal_slides_com/src/ts_main.py'),
941
+ loc('../tidal_slides_com/src/ts_ai.py'),
942
+ loc('../../envs/gradio-3/lib/python3.12/site-packages/transformers/generation/utils.py'),
943
+ >>>>>>> 35c5766 (dev)
944
  loc('app.py')]
945
  guimgr.visual-state = {loc('../../envs/gradio-3/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py'): {'attrib-starts': [('ErrorHandler|0|',
946
  140),
 
966
  'selection_end': 4266,
967
  'selection_start': 4266,
968
  'zoom': 0},
969
+ <<<<<<< HEAD
970
+ =======
971
+ loc('../../envs/gradio-3/lib/python3.12/site-packages/torch/nn/modules/module.py'): {'attrib-starts': [('Module|0|',
972
+ 398),
973
+ ('Module|0|._call_impl|0|',
974
+ 1739)],
975
+ 'code-line': ' return forward_call(*args, **kwargs)\n',
976
+ 'first-line': 1723,
977
+ 'folded-linenos': [],
978
+ 'sel-line': 1746,
979
+ 'sel-line-start': 69769,
980
+ 'selection_end': 69769,
981
+ 'selection_start': 69769,
982
+ 'zoom': 0},
983
+ >>>>>>> 35c5766 (dev)
984
  loc('../../envs/gradio-3/lib/python3.12/site-packages/transformers/pipelines/base.py'): {'attrib-starts': [('infer_framework_load_model|0|',
985
  205)],
986
  'code-line': ' raise RuntimeError(\n',
selenium_click.py CHANGED
@@ -6,7 +6,12 @@ def test(text):
6
  "summarization",
7
  model=model_name,
8
  tokenizer=model_name,
 
9
  clean_up_tokenization_spaces=True,
 
 
 
 
10
  )
11
 
12
  max_length = 500
@@ -16,7 +21,11 @@ def test(text):
16
  from pprint import pprint as pp
17
 
18
 
 
19
  pp(test(''' Shorecode is a leading professional software development and IT service provider.
20
  Our objective is to provide our clients with valuable tools to improve workflows with AI, automation or other techniques. We create impressive state-of-the-art data manipulation and automation tools. At your request, your software solution interface will be implemented as a GUI (Graphical User Interface), webpage, as a chat-bot (Telegram, Discord, etc.) or any other interface requirements you have. For those that are at ease with using a command line interface, we can skip the bells and whistles.
21
  When you choose to enlist our services, we will meet the expectation that your request will be completed with regular progress updates. We take pride in developing turn-key solutions that are intuitive.
22
- The code that we write will always be maintainable and well documented according to industry standards. Any bugs arising from defects in our workmanship are covered under warranty. We strive to provide a solution with long-term value to our clients.'''))
 
 
 
 
6
  "summarization",
7
  model=model_name,
8
  tokenizer=model_name,
9
+ <<<<<<< HEAD
10
  clean_up_tokenization_spaces=True,
11
+ =======
12
+ clean_up_tokenization_spaces=True,
13
+ model_kwargs={'cache_dir': './cache'}
14
+ >>>>>>> 35c5766 (dev)
15
  )
16
 
17
  max_length = 500
 
21
  from pprint import pprint as pp
22
 
23
 
24
+ <<<<<<< HEAD
25
  pp(test(''' Shorecode is a leading professional software development and IT service provider.
26
  Our objective is to provide our clients with valuable tools to improve workflows with AI, automation or other techniques. We create impressive state-of-the-art data manipulation and automation tools. At your request, your software solution interface will be implemented as a GUI (Graphical User Interface), webpage, as a chat-bot (Telegram, Discord, etc.) or any other interface requirements you have. For those that are at ease with using a command line interface, we can skip the bells and whistles.
27
  When you choose to enlist our services, we will meet the expectation that your request will be completed with regular progress updates. We take pride in developing turn-key solutions that are intuitive.
28
+ The code that we write will always be maintainable and well documented according to industry standards. Any bugs arising from defects in our workmanship are covered under warranty. We strive to provide a solution with long-term value to our clients.'''))
29
+ =======
30
+ 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 consider.'''))
31
+ >>>>>>> 35c5766 (dev)