Kevin Fink commited on
Commit
f12c203
·
1 Parent(s): 8a66ad2
Files changed (3) hide show
  1. app.py +5 -6
  2. gradio-3.wpu +209 -239
  3. selenium_click.py +22 -0
app.py CHANGED
@@ -292,20 +292,20 @@ def run_train(dataset_name, hub_id, api_key, num_epochs, batch_size, lr, grad):
292
  elif 'encoder.block.0.layer.0.DenseReluDense.wo.weight' in name: # Another example layer
293
  torch.nn.init.kaiming_normal_(param.data) # Kaiming initialization
294
 
295
- config = AutoConfig.from_pretrained("shorecode/t5-efficient-tiny-nh8-summarizer")
296
  model = AutoModelForSeq2SeqLM.from_config(config)
297
  initialize_weights(model)
298
  lora_config = LoraConfig(
299
- r=16, # Rank of the low-rank adaptation
300
- lora_alpha=32, # Scaling factor
301
  lora_dropout=0.1, # Dropout for LoRA layers
302
  bias="none" # Bias handling
303
  )
304
- #model = get_peft_model(model, lora_config)
305
  result = fine_tune_model(model, dataset_name, hub_id, api_key, num_epochs, batch_size, lr, grad)
306
  return result
307
 
308
-
309
  try:
310
  iface = gr.Interface(
311
  fn=test,
@@ -344,4 +344,3 @@ try:
344
  iface.launch()
345
  except Exception as e:
346
  print(f"An error occurred: {str(e)}, TB: {traceback.format_exc()}")
347
- '''
 
292
  elif 'encoder.block.0.layer.0.DenseReluDense.wo.weight' in name: # Another example layer
293
  torch.nn.init.kaiming_normal_(param.data) # Kaiming initialization
294
 
295
+ config = AutoConfig.from_pretrained("google/t5-efficient-tiny-nh8")
296
  model = AutoModelForSeq2SeqLM.from_config(config)
297
  initialize_weights(model)
298
  lora_config = LoraConfig(
299
+ r=4, # Rank of the low-rank adaptation
300
+ lora_alpha=8, # Scaling factor
301
  lora_dropout=0.1, # Dropout for LoRA layers
302
  bias="none" # Bias handling
303
  )
304
+ model = get_peft_model(model, lora_config)
305
  result = fine_tune_model(model, dataset_name, hub_id, api_key, num_epochs, batch_size, lr, grad)
306
  return result
307
 
308
+ '''
309
  try:
310
  iface = gr.Interface(
311
  fn=test,
 
344
  iface.launch()
345
  except Exception as e:
346
  print(f"An error occurred: {str(e)}, TB: {traceback.format_exc()}")
 
gradio-3.wpu CHANGED
@@ -27,37 +27,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
27
  'code-line': '',
28
  'first-line': 0,
29
  'folded-linenos': [],
30
- 'history': {None: ["sorted(['checkpoint-200', 'checkpoint-1000', 'checkpoint-800'])\n",
31
- "['checkpoint-200', 'checkpoint-1000', 'checkpoint-800'].sort\n",
32
- "['checkpoint-200', 'checkpoint-1000', 'checkpoint-800'].sort()\n",
33
- "print(['checkpoint-200', 'checkpoint-1000', 'checkpoint-800'].sort())\n",
34
- 'import glob\n',
35
- 'import os\n',
36
- "previous_checkpoints = sorted(glob.glob('src'), key=os.path.getmtime)\n",
37
- "previous_checkpoints = sorted(glob.glob('.'), key=os.path.getmtime)\n",
38
- "previous_checkpoints = sorted(glob.glob('/'), key=os.path.getmtime)\n",
39
- "glob.glob('.')\n",
40
- "glob.glob('.', recursive=True)\n",
41
- "glob.glob('.', recursive=True, root_dir='.')\n",
42
- "glob.glob('*', recursive=True, root_dir='.')\n",
43
- "glob.glob('*', recursive=True)\n",
44
- "glob.glob('*')\n",
45
- "glob.glob('t*')\n",
46
- "os.path.dirname('/home/kevin/kevin.x')\n",
47
- "previous_checkpoints = sorted(glob.glob('*'), key=os.path.getmtime)\n",
48
- "previous_checkpoints = sorted(glob.glob('src/*'), key=os.path.getmtime)\n",
49
- "d=['checkpoint-200', 'checkpoint-1000', 'checkpoint-800']\n",
50
- 'previous_checkpoints = sorted(glob.glob(d),)\n',
51
- "'checkpoint-200'.find('-')\n",
52
- "'checkpoint-200'[10]\n",
53
- "'checkpoint-200'[11]\n",
54
- "def get_checkpoint_int(s):\n int_index = s.find('-')\n return int(s[int_index+1])\n\n",
55
- 'get_checkpoint_int(d[0])\n',
56
- "def get_checkpoint_int(s):\n int_index = s.find('-')\n return int(s[int_index+1:])\n\n",
57
- 'previous_checkpoints = sorted(d, key=get_checkpoint_int)\n',
58
- 'previous_checkpoints = sorted(d, key=get_checkpoint_int, reverse=True)\n',
59
- 'previous_checkpoints[-2]\n',
60
- 'previous_checkpoints\n']},
61
  'launch-id': None,
62
  'sel-line': 2,
63
  'sel-line-start': 128,
@@ -268,10 +238,10 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
268
  'top-node': [('generic attribute',
269
  loc('../tidal_slides_com/tests/unit/test_ts_util.py'),
270
  'mock_get_token')]},
271
- loc('unknown:<untitled> #2'): {'expanded-nodes': [],
272
  'selected-nodes': [],
273
  'top-node': [('generic attribute',
274
- loc('unknown:<untitled> #3'),
275
  'r')]}},
276
  'browse_mode': 'Current Module',
277
  'follow-selection': False,
@@ -302,7 +272,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
302
  'primary_view_state': {'area': 'wide',
303
  'constraint': None,
304
  'current_pages': [2,
305
- 1],
306
  'notebook_display': 'normal',
307
  'notebook_percent': 0.28547008547008546,
308
  'override_title': None,
@@ -455,222 +425,178 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
455
  'wide',
456
  1,
457
  {})],
458
- 'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('app.py'),
459
- {'attrib-starts': [('fine_tune_model|0|',
460
- 30)],
461
- 'code-line': " print(os.listdir('/data/results'))\n",
462
- 'first-line': 228,
 
 
463
  'folded-linenos': [],
464
- 'sel-line': 234,
465
- 'sel-line-start': 10995,
466
- 'selection_end': 11045,
467
- 'selection_start': 11045,
468
  'zoom': 0},
469
- 1733820110.295894],
470
- [loc('app.py'),
471
- {'attrib-starts': [('fine_tune_model|0|',
472
- 30)],
473
- 'code-line': ' print(f\'ROOTDIR: {os.listdir("/data/results")}\')\n',
474
- 'first-line': 228,
475
  'folded-linenos': [],
476
- 'sel-line': 231,
477
- 'sel-line-start': 10856,
478
- 'selection_end': 10893,
479
- 'selection_start': 10893,
480
  'zoom': 0},
481
- 1733827087.3649247],
482
  [loc('app.py'),
483
- {'attrib-starts': [('fine_tune_model|0|',
484
- 30)],
485
- 'code-line': ' print(f\'ROOTDIR: {os.listdir("/data/results")}\')\n',
486
- 'first-line': 159,
487
  'folded-linenos': [],
488
- 'sel-line': 231,
489
- 'sel-line-start': 10856,
490
- 'selection_end': 10893,
491
- 'selection_start': 10893,
492
  'zoom': 0},
493
- 1733827099.400229],
494
  [loc('app.py'),
495
  {'attrib-starts': [('fine_tune_model|0|',
496
  30)],
497
- 'code-line': ' logging_steps=200,\n',
498
- 'first-line': 72,
499
  'folded-linenos': [],
500
- 'sel-line': 84,
501
- 'sel-line-start': 3389,
502
- 'selection_end': 3416,
503
- 'selection_start': 3416,
504
  'zoom': 0},
505
- 1733827130.3357885],
506
  [loc('app.py'),
507
- {'attrib-starts': [('fine_tune_model|0|',
508
- 30)],
509
- 'code-line': " previous_checkpoints = sorted(glob.glob(os.path.join(os.path.dirname(checkpoint_dir), 'checkpoint-*')), key=os.path.getmtime)\n",
510
- 'first-line': 231,
511
  'folded-linenos': [],
512
- 'sel-line': 244,
513
- 'sel-line-start': 11475,
514
- 'selection_end': 11555,
515
- 'selection_start': 11555,
516
  'zoom': 0},
517
- 1733881654.3978486],
518
- [loc('../../../../usr/lib/python3.12/posixpath.py'),
519
- {'attrib-starts': [('_joinrealpath|0|',
520
- 439)],
521
- 'code-line': ' st = os.lstat(newpath)\n',
522
- 'first-line': 454,
523
  'folded-linenos': [],
524
- 'sel-line': 469,
525
- 'sel-line-start': 14128,
526
- 'selection_end': 14128,
527
- 'selection_start': 14128,
528
  'zoom': 0},
529
- 1733881656.3022408],
530
- [loc('../../../../usr/lib/python3.12/posixpath.py'),
531
- {'attrib-starts': [('split|0|',
532
- 99)],
533
- 'code-line': ' p = os.fspath(p)\n',
534
- 'first-line': 97,
535
  'folded-linenos': [],
536
- 'sel-line': 102,
537
- 'sel-line-start': 3425,
538
- 'selection_end': 3425,
539
- 'selection_start': 3425,
540
  'zoom': 0},
541
- 1733881665.7618647],
542
  [loc('app.py'),
543
- {'attrib-starts': [('fine_tune_model|0|',
544
- 30)],
545
- 'code-line': ' print(f"Loading previous checkpoint: {check}")\n',
546
- 'first-line': 237,
547
  'folded-linenos': [],
548
- 'sel-line': 252,
549
- 'sel-line-start': 11695,
550
- 'selection_end': 11758,
551
- 'selection_start': 11758,
552
  'zoom': 0},
553
- 1733882358.8127315],
554
- [loc('../tidal_slides_com/src/util/ts_util.py'),
555
  {'attrib-starts': [],
556
- 'code-line': 'async def verify_transaction(transaction_id: int):\n',
557
- 'first-line': 120,
558
  'folded-linenos': [],
559
- 'sel-line': 59,
560
- 'sel-line-start': 1389,
561
- 'selection_end': 1417,
562
- 'selection_start': 1399,
563
  'zoom': 0},
564
- 1733882383.6024365],
565
- [loc('selenium_click.py'),
566
  {'attrib-starts': [],
567
- 'code-line': '\n',
568
- 'first-line': 0,
569
  'folded-linenos': [],
570
- 'sel-line': 0,
571
- 'sel-line-start': 0,
572
- 'selection_end': 0,
573
- 'selection_start': 0,
574
  'zoom': 0},
575
- 1733882429.9050066],
576
- [loc('../../.wingpro10/updates/from_10.0.3.0/10.0.4.5/doc/TOC'),
577
- {'displayed-index': -1,
578
- 'viewer-state': {'history': [-1,
579
- 0],
580
- 'history-pos': 0,
581
- 'index': -1,
582
- 'top': 0,
583
- 'top-left-pos': 0}},
584
- 1733882459.832084],
585
- [loc('selenium_click.py'),
586
  {'attrib-starts': [],
587
- 'code-line': ' \n',
588
- 'first-line': 18,
589
  'folded-linenos': [],
590
- 'sel-line': 18,
591
- 'sel-line-start': 611,
592
- 'selection_end': 615,
593
- 'selection_start': 615,
594
  'zoom': 0},
595
- 1733883001.3479598],
596
- [loc('../../envs/gradio-3/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py'),
597
- {'attrib-starts': [('ErrorHandler|0|',
598
- 140),
599
- ('ErrorHandler|0|.check_response|0|',
600
- 143)],
601
- 'code-line': ' raise exception_class(message, screen, stacktrace)\n',
602
- 'first-line': 209,
603
  'folded-linenos': [],
604
- 'sel-line': 231,
605
- 'sel-line-start': 10605,
606
- 'selection_end': 10605,
607
- 'selection_start': 10605,
608
  'zoom': 0},
609
- 1733883008.4021084],
610
- [loc('selenium_click.py'),
611
  {'attrib-starts': [],
612
- 'code-line': 'from selenium.webdriver.support.ui import WebDriverWait\n',
613
- 'first-line': 0,
614
  'folded-linenos': [],
615
- 'sel-line': 5,
616
- 'sel-line-start': 189,
617
- 'selection_end': 189,
618
- 'selection_start': 189,
619
  'zoom': 0},
620
- 1733883673.3276145],
621
- [loc('../../envs/gradio-3/lib/python3.12/site-packages/selenium/webdriver/support/wait.py'),
622
- {'attrib-starts': [('WebDriverWait|0|',
623
- 38),
624
- ('WebDriverWait|0|.until|0|',
625
- 80)],
626
- 'code-line': ' raise TimeoutException(message, screen, stacktrace)\n',
627
- 'first-line': 82,
628
  'folded-linenos': [],
629
- 'sel-line': 104,
630
- 'sel-line-start': 4266,
631
- 'selection_end': 4266,
632
- 'selection_start': 4266,
633
  'zoom': 0},
634
- 1733883678.831193],
635
  [loc('selenium_click.py'),
636
  {'attrib-starts': [],
637
- 'code-line': ' WebDriverWait(driver, 30).until(\n',
638
  'first-line': 0,
639
  'folded-linenos': [],
640
  'sel-line': 14,
641
- 'sel-line-start': 438,
642
- 'selection_end': 466,
643
- 'selection_start': 466,
644
- 'zoom': 0},
645
- 1733883831.5308323],
646
- [loc('../../envs/gradio-3/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py'),
647
- {'attrib-starts': [('ErrorHandler|0|',
648
- 140),
649
- ('ErrorHandler|0|.check_response|0|',
650
- 143)],
651
- 'code-line': ' raise exception_class(message, screen, stacktrace)\n',
652
- 'first-line': 218,
653
- 'folded-linenos': [],
654
- 'sel-line': 231,
655
- 'sel-line-start': 10605,
656
- 'selection_end': 10605,
657
- 'selection_start': 10605,
658
  'zoom': 0},
659
- 1733883833.4841597],
660
  [loc('selenium_click.py'),
661
  {'attrib-starts': [],
662
- 'code-line': " text_areas = driver.find_elements(By.TAG_NAME, 'textarea')\n",
663
- 'first-line': 11,
664
- 'folded-linenos': [],
665
- 'sel-line': 21,
666
- 'sel-line-start': 771,
667
- 'selection_end': 833,
668
- 'selection_start': 833,
669
- 'zoom': 0},
670
- 1733883947.2524962],
671
- [loc('app.py'),
672
- {'attrib-starts': [],
673
- 'code-line': 'import spaces\n',
674
  'first-line': 0,
675
  'folded-linenos': [],
676
  'sel-line': 0,
@@ -678,48 +604,82 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
678
  'selection_end': 0,
679
  'selection_start': 0,
680
  'zoom': 0},
681
- 1733883957.4314425],
682
- [loc('app.py'),
683
- {'attrib-starts': [('fine_tune_model|0|',
684
- 30)],
685
- 'code-line': " os.remove(os.path.join('/data/results', check))\n",
686
- 'first-line': 240,
687
  'folded-linenos': [],
688
- 'sel-line': 252,
689
- 'sel-line-start': 11667,
690
- 'selection_end': 11734,
691
- 'selection_start': 11734,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
692
  'zoom': 0},
693
- 1733884182.266322]],
694
  20),
695
- 'current-loc': loc('selenium_click.py'),
696
  'editor-state-list': [(loc('app.py'),
697
- {'attrib-starts': [('fine_tune_model|0|',
698
- 30)],
699
- 'code-line': " os.remove(os.path.join('/data/results', check))\n",
700
- 'first-line': 240,
701
  'folded-linenos': [],
702
- 'sel-line': 252,
703
- 'sel-line-start': 11667,
704
- 'selection_end': 11734,
705
- 'selection_start': 11734,
706
  'zoom': 0}),
707
  (loc('selenium_click.py'),
708
  {'attrib-starts': [],
709
- 'code-line': ' \n',
710
- 'first-line': 9,
711
  'folded-linenos': [],
712
- 'sel-line': 23,
713
- 'sel-line-start': 835,
714
- 'selection_end': 835,
715
- 'selection_start': 835,
716
  'zoom': 0})],
717
- 'has-focus': False,
718
  'locked': False},
719
  [loc('app.py'),
720
  loc('selenium_click.py')]),
721
- 'open_files': ['app.py',
722
- 'selenium_click.py']},
723
  'saved_notebook_display': None,
724
  'split_percents': {0: 0.4410585404971933,
725
  1: 0.5,
@@ -727,8 +687,8 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
727
  'splits': 2,
728
  'tab_location': 'top',
729
  'traversal_pos': ((1,
730
- 1),
731
- 1733884739.5002303),
732
  'user_data': {}},
733
  'saved_notebook_display': None,
734
  'split_percents': {0: 0.49743589743589745},
@@ -736,14 +696,14 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
736
  'tab_location': 'left',
737
  'traversal_pos': ((1,
738
  0),
739
- 1733884739.4044967),
740
  'user_data': {}},
741
  'window-alloc': (0,
742
  0,
743
  1920,
744
- 793)}]}
745
- guimgr.recent-documents = [loc('selenium_click.py'),
746
- loc('app.py')]
747
  guimgr.visual-state = {loc('../../envs/gradio-3/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py'): {'attrib-starts': [('ErrorHandler|0|',
748
  140),
749
  ('ErrorHandler|0|.check_response|0|',
@@ -767,6 +727,16 @@ guimgr.visual-state = {loc('../../envs/gradio-3/lib/python3.12/site-packages/sel
767
  'sel-line-start': 4266,
768
  'selection_end': 4266,
769
  'selection_start': 4266,
 
 
 
 
 
 
 
 
 
 
770
  'zoom': 0},
771
  loc('gradio-3.wpr'): {'attrib-starts': [],
772
  'code-line': '#!wing\n',
 
27
  'code-line': '',
28
  'first-line': 0,
29
  'folded-linenos': [],
30
+ 'history': {},
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  'launch-id': None,
32
  'sel-line': 2,
33
  'sel-line-start': 128,
 
238
  'top-node': [('generic attribute',
239
  loc('../tidal_slides_com/tests/unit/test_ts_util.py'),
240
  'mock_get_token')]},
241
+ loc('unknown:<untitled> #1'): {'expanded-nodes': [],
242
  'selected-nodes': [],
243
  'top-node': [('generic attribute',
244
+ loc('unknown:<untitled> #2'),
245
  'r')]}},
246
  'browse_mode': 'Current Module',
247
  'follow-selection': False,
 
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
  'wide',
426
  1,
427
  {})],
428
+ 'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('../../envs/gradio-3/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py'),
429
+ {'attrib-starts': [('ErrorHandler|0|',
430
+ 140),
431
+ ('ErrorHandler|0|.check_response|0|',
432
+ 143)],
433
+ 'code-line': ' raise exception_class(message, screen, stacktrace)\n',
434
+ 'first-line': 218,
435
  'folded-linenos': [],
436
+ 'sel-line': 231,
437
+ 'sel-line-start': 10605,
438
+ 'selection_end': 10605,
439
+ 'selection_start': 10605,
440
  'zoom': 0},
441
+ 1733883833.4841597],
442
+ [loc('selenium_click.py'),
443
+ {'attrib-starts': [],
444
+ 'code-line': " text_areas = driver.find_elements(By.TAG_NAME, 'textarea')\n",
445
+ 'first-line': 11,
 
446
  'folded-linenos': [],
447
+ 'sel-line': 21,
448
+ 'sel-line-start': 771,
449
+ 'selection_end': 833,
450
+ 'selection_start': 833,
451
  'zoom': 0},
452
+ 1733883947.2524962],
453
  [loc('app.py'),
454
+ {'attrib-starts': [],
455
+ 'code-line': 'import spaces\n',
456
+ 'first-line': 0,
 
457
  'folded-linenos': [],
458
+ 'sel-line': 0,
459
+ 'sel-line-start': 0,
460
+ 'selection_end': 0,
461
+ 'selection_start': 0,
462
  'zoom': 0},
463
+ 1733883957.4314425],
464
  [loc('app.py'),
465
  {'attrib-starts': [('fine_tune_model|0|',
466
  30)],
467
+ 'code-line': " os.remove(os.path.join('/data/results', check))\n",
468
+ 'first-line': 240,
469
  'folded-linenos': [],
470
+ 'sel-line': 252,
471
+ 'sel-line-start': 11667,
472
+ 'selection_end': 11734,
473
+ 'selection_start': 11734,
474
  'zoom': 0},
475
+ 1733884182.266322],
476
  [loc('app.py'),
477
+ {'attrib-starts': [],
478
+ 'code-line': '@spaces.GPU\n',
479
+ 'first-line': 261,
 
480
  'folded-linenos': [],
481
+ 'sel-line': 269,
482
+ 'sel-line-start': 12530,
483
+ 'selection_end': 12541,
484
+ 'selection_start': 12541,
485
  'zoom': 0},
486
+ 1733888916.495776],
487
+ [loc('app.py'),
488
+ {'attrib-starts': [],
489
+ 'code-line': ' description="This interface allows you to test shorecode/t5-efficient-tiny-nh8-summarizer."\n',
490
+ 'first-line': 301,
 
491
  'folded-linenos': [],
492
+ 'sel-line': 316,
493
+ 'sel-line-start': 14328,
494
+ 'selection_end': 14425,
495
+ 'selection_start': 14393,
496
  'zoom': 0},
497
+ 1733889109.1047828],
498
+ [loc('app.py'),
499
+ {'attrib-starts': [],
500
+ 'code-line': ' ],\n',
501
+ 'first-line': 301,
 
502
  'folded-linenos': [],
503
+ 'sel-line': 313,
504
+ 'sel-line-start': 14201,
505
+ 'selection_end': 14201,
506
+ 'selection_start': 14201,
507
  'zoom': 0},
508
+ 1733889187.7480035],
509
  [loc('app.py'),
510
+ {'attrib-starts': [],
511
+ 'code-line': 'except Exception as e:\n',
512
+ 'first-line': 325,
 
513
  'folded-linenos': [],
514
+ 'sel-line': 344,
515
+ 'sel-line-start': 15456,
516
+ 'selection_end': 15478,
517
+ 'selection_start': 15478,
518
  'zoom': 0},
519
+ 1733889189.8301165],
520
+ [loc('app.py'),
521
  {'attrib-starts': [],
522
+ 'code-line': "'''",
523
+ 'first-line': 325,
524
  'folded-linenos': [],
525
+ 'sel-line': 346,
526
+ 'sel-line-start': 15551,
527
+ 'selection_end': 15554,
528
+ 'selection_start': 15554,
529
  'zoom': 0},
530
+ 1733889294.4289477],
531
+ [loc('app.py'),
532
  {'attrib-starts': [],
533
+ 'code-line': 'def test(text):\n',
534
+ 'first-line': 268,
535
  'folded-linenos': [],
536
+ 'sel-line': 269,
537
+ 'sel-line-start': 12530,
538
+ 'selection_end': 12530,
539
+ 'selection_start': 12530,
540
  'zoom': 0},
541
+ 1733889581.404085],
542
+ [loc('app.py'),
 
 
 
 
 
 
 
 
 
543
  {'attrib-starts': [],
544
+ 'code-line': 'def test(text):\n',
545
+ 'first-line': 295,
546
  'folded-linenos': [],
547
+ 'sel-line': 269,
548
+ 'sel-line-start': 12530,
549
+ 'selection_end': 12530,
550
+ 'selection_start': 12530,
551
  'zoom': 0},
552
+ 1733889584.5569227],
553
+ [loc('app.py'),
554
+ {'attrib-starts': [],
555
+ 'code-line': "'''\n",
556
+ 'first-line': 292,
 
 
 
557
  'folded-linenos': [],
558
+ 'sel-line': 307,
559
+ 'sel-line-start': 14083,
560
+ 'selection_end': 14086,
561
+ 'selection_start': 14086,
562
  'zoom': 0},
563
+ 1733889937.3925433],
564
+ [loc('app.py'),
565
  {'attrib-starts': [],
566
+ 'code-line': '',
567
+ 'first-line': 340,
568
  'folded-linenos': [],
569
+ 'sel-line': 346,
570
+ 'sel-line-start': 15554,
571
+ 'selection_end': 15554,
572
+ 'selection_start': 15554,
573
  'zoom': 0},
574
+ 1733889940.8484015],
575
+ [loc('app.py'),
576
+ {'attrib-starts': [],
577
+ 'code-line': 'def test(text):\n',
578
+ 'first-line': 268,
 
 
 
579
  'folded-linenos': [],
580
+ 'sel-line': 270,
581
+ 'sel-line-start': 12542,
582
+ 'selection_end': 12962,
583
+ 'selection_start': 12542,
584
  'zoom': 0},
585
+ 1733889952.5545285],
586
  [loc('selenium_click.py'),
587
  {'attrib-starts': [],
588
+ 'code-line': 'print',
589
  'first-line': 0,
590
  'folded-linenos': [],
591
  'sel-line': 14,
592
+ 'sel-line-start': 421,
593
+ 'selection_end': 426,
594
+ 'selection_start': 426,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
595
  'zoom': 0},
596
+ 1733889960.5871687],
597
  [loc('selenium_click.py'),
598
  {'attrib-starts': [],
599
+ 'code-line': 'import transformers\n',
 
 
 
 
 
 
 
 
 
 
 
600
  'first-line': 0,
601
  'folded-linenos': [],
602
  'sel-line': 0,
 
604
  'selection_end': 0,
605
  'selection_start': 0,
606
  'zoom': 0},
607
+ 1733890178.8795424],
608
+ [loc('../../envs/gradio-3/lib/python3.12/site-packages/transformers/pipelines/base.py'),
609
+ {'attrib-starts': [('infer_framework_load_model|0|',
610
+ 205)],
611
+ 'code-line': ' raise RuntimeError(\n',
612
+ 'first-line': 217,
613
  'folded-linenos': [],
614
+ 'sel-line': 239,
615
+ 'sel-line-start': 9148,
616
+ 'selection_end': 9148,
617
+ 'selection_start': 9148,
618
+ 'zoom': 0},
619
+ 1733890192.0519993],
620
+ [loc('selenium_click.py'),
621
+ {'attrib-starts': [],
622
+ 'code-line': 'def test(text): \n',
623
+ 'first-line': 0,
624
+ 'folded-linenos': [],
625
+ 'sel-line': 2,
626
+ 'sel-line-start': 35,
627
+ 'selection_end': 50,
628
+ 'selection_start': 50,
629
+ 'zoom': 0},
630
+ 1733890223.0760849],
631
+ [loc('../../envs/gradio-3/lib/python3.12/site-packages/transformers/pipelines/base.py'),
632
+ {'attrib-starts': [('infer_framework_load_model|0|',
633
+ 205)],
634
+ 'code-line': ' raise RuntimeError(\n',
635
+ 'first-line': 226,
636
+ 'folded-linenos': [],
637
+ 'sel-line': 239,
638
+ 'sel-line-start': 9148,
639
+ 'selection_end': 9148,
640
+ 'selection_start': 9148,
641
+ 'zoom': 0},
642
+ 1733890299.157337],
643
+ [loc('selenium_click.py'),
644
+ {'attrib-starts': [],
645
+ 'code-line': 'def test(text): \n',
646
+ 'first-line': 0,
647
+ 'folded-linenos': [],
648
+ 'sel-line': 2,
649
+ 'sel-line-start': 35,
650
+ 'selection_end': 50,
651
+ 'selection_start': 50,
652
  'zoom': 0},
653
+ 1733890425.432772]],
654
  20),
655
+ 'current-loc': loc('app.py'),
656
  'editor-state-list': [(loc('app.py'),
657
+ {'attrib-starts': [('run_train|0|',
658
+ 286)],
659
+ 'code-line': ' config = AutoConfig.from_pretrained("google/t5-efficient-tiny-nh8")\n',
660
+ 'first-line': 273,
661
  'folded-linenos': [],
662
+ 'sel-line': 294,
663
+ 'sel-line-start': 13525,
664
+ 'selection_end': 13594,
665
+ 'selection_start': 13566,
666
  'zoom': 0}),
667
  (loc('selenium_click.py'),
668
  {'attrib-starts': [],
669
+ 'code-line': 'def test(text): \n',
670
+ 'first-line': 0,
671
  'folded-linenos': [],
672
+ 'sel-line': 2,
673
+ 'sel-line-start': 35,
674
+ 'selection_end': 50,
675
+ 'selection_start': 50,
676
  'zoom': 0})],
677
+ 'has-focus': True,
678
  'locked': False},
679
  [loc('app.py'),
680
  loc('selenium_click.py')]),
681
+ 'open_files': ['selenium_click.py',
682
+ 'app.py']},
683
  'saved_notebook_display': None,
684
  'split_percents': {0: 0.4410585404971933,
685
  1: 0.5,
 
687
  'splits': 2,
688
  'tab_location': 'top',
689
  'traversal_pos': ((1,
690
+ 2),
691
+ 1733890264.8827372),
692
  'user_data': {}},
693
  'saved_notebook_display': None,
694
  'split_percents': {0: 0.49743589743589745},
 
696
  'tab_location': 'left',
697
  'traversal_pos': ((1,
698
  0),
699
+ 1733890261.2293193),
700
  'user_data': {}},
701
  'window-alloc': (0,
702
  0,
703
  1920,
704
+ 808)}]}
705
+ guimgr.recent-documents = [loc('app.py'),
706
+ loc('selenium_click.py')]
707
  guimgr.visual-state = {loc('../../envs/gradio-3/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py'): {'attrib-starts': [('ErrorHandler|0|',
708
  140),
709
  ('ErrorHandler|0|.check_response|0|',
 
727
  'sel-line-start': 4266,
728
  'selection_end': 4266,
729
  'selection_start': 4266,
730
+ 'zoom': 0},
731
+ loc('../../envs/gradio-3/lib/python3.12/site-packages/transformers/pipelines/base.py'): {'attrib-starts': [('infer_framework_load_model|0|',
732
+ 205)],
733
+ 'code-line': ' raise RuntimeError(\n',
734
+ 'first-line': 226,
735
+ 'folded-linenos': [],
736
+ 'sel-line': 239,
737
+ 'sel-line-start': 9148,
738
+ 'selection_end': 9148,
739
+ 'selection_start': 9148,
740
  'zoom': 0},
741
  loc('gradio-3.wpr'): {'attrib-starts': [],
742
  'code-line': '#!wing\n',
selenium_click.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ )
11
+
12
+ max_length = 500
13
+ summary = summarizer(text, max_length=max_length, min_length=40, no_repeat_ngram_size=2)
14
+ return summary
15
+
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.'''))