Kevin Fink
commited on
Commit
·
f12c203
1
Parent(s):
8a66ad2
dev
Browse files- app.py +5 -6
- gradio-3.wpu +209 -239
- 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("
|
296 |
model = AutoModelForSeq2SeqLM.from_config(config)
|
297 |
initialize_weights(model)
|
298 |
lora_config = LoraConfig(
|
299 |
-
r=
|
300 |
-
lora_alpha=
|
301 |
lora_dropout=0.1, # Dropout for LoRA layers
|
302 |
bias="none" # Bias handling
|
303 |
)
|
304 |
-
|
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': {
|
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> #
|
272 |
'selected-nodes': [],
|
273 |
'top-node': [('generic attribute',
|
274 |
-
loc('unknown:<untitled> #
|
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 |
-
|
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('
|
459 |
-
{'attrib-starts': [('
|
460 |
-
|
461 |
-
|
462 |
-
|
|
|
|
|
463 |
'folded-linenos': [],
|
464 |
-
'sel-line':
|
465 |
-
'sel-line-start':
|
466 |
-
'selection_end':
|
467 |
-
'selection_start':
|
468 |
'zoom': 0},
|
469 |
-
|
470 |
-
[loc('
|
471 |
-
{'attrib-starts': [
|
472 |
-
|
473 |
-
'
|
474 |
-
'first-line': 228,
|
475 |
'folded-linenos': [],
|
476 |
-
'sel-line':
|
477 |
-
'sel-line-start':
|
478 |
-
'selection_end':
|
479 |
-
'selection_start':
|
480 |
'zoom': 0},
|
481 |
-
|
482 |
[loc('app.py'),
|
483 |
-
{'attrib-starts': [
|
484 |
-
|
485 |
-
'
|
486 |
-
'first-line': 159,
|
487 |
'folded-linenos': [],
|
488 |
-
'sel-line':
|
489 |
-
'sel-line-start':
|
490 |
-
'selection_end':
|
491 |
-
'selection_start':
|
492 |
'zoom': 0},
|
493 |
-
|
494 |
[loc('app.py'),
|
495 |
{'attrib-starts': [('fine_tune_model|0|',
|
496 |
30)],
|
497 |
-
'code-line': '
|
498 |
-
'first-line':
|
499 |
'folded-linenos': [],
|
500 |
-
'sel-line':
|
501 |
-
'sel-line-start':
|
502 |
-
'selection_end':
|
503 |
-
'selection_start':
|
504 |
'zoom': 0},
|
505 |
-
|
506 |
[loc('app.py'),
|
507 |
-
{'attrib-starts': [
|
508 |
-
|
509 |
-
'
|
510 |
-
'first-line': 231,
|
511 |
'folded-linenos': [],
|
512 |
-
'sel-line':
|
513 |
-
'sel-line-start':
|
514 |
-
'selection_end':
|
515 |
-
'selection_start':
|
516 |
'zoom': 0},
|
517 |
-
|
518 |
-
[loc('
|
519 |
-
{'attrib-starts': [
|
520 |
-
|
521 |
-
'
|
522 |
-
'first-line': 454,
|
523 |
'folded-linenos': [],
|
524 |
-
'sel-line':
|
525 |
-
'sel-line-start':
|
526 |
-
'selection_end':
|
527 |
-
'selection_start':
|
528 |
'zoom': 0},
|
529 |
-
|
530 |
-
[loc('
|
531 |
-
{'attrib-starts': [
|
532 |
-
|
533 |
-
'
|
534 |
-
'first-line': 97,
|
535 |
'folded-linenos': [],
|
536 |
-
'sel-line':
|
537 |
-
'sel-line-start':
|
538 |
-
'selection_end':
|
539 |
-
'selection_start':
|
540 |
'zoom': 0},
|
541 |
-
|
542 |
[loc('app.py'),
|
543 |
-
{'attrib-starts': [
|
544 |
-
|
545 |
-
'
|
546 |
-
'first-line': 237,
|
547 |
'folded-linenos': [],
|
548 |
-
'sel-line':
|
549 |
-
'sel-line-start':
|
550 |
-
'selection_end':
|
551 |
-
'selection_start':
|
552 |
'zoom': 0},
|
553 |
-
|
554 |
-
[loc('
|
555 |
{'attrib-starts': [],
|
556 |
-
'code-line': '
|
557 |
-
'first-line':
|
558 |
'folded-linenos': [],
|
559 |
-
'sel-line':
|
560 |
-
'sel-line-start':
|
561 |
-
'selection_end':
|
562 |
-
'selection_start':
|
563 |
'zoom': 0},
|
564 |
-
|
565 |
-
[loc('
|
566 |
{'attrib-starts': [],
|
567 |
-
'code-line': '
|
568 |
-
'first-line':
|
569 |
'folded-linenos': [],
|
570 |
-
'sel-line':
|
571 |
-
'sel-line-start':
|
572 |
-
'selection_end':
|
573 |
-
'selection_start':
|
574 |
'zoom': 0},
|
575 |
-
|
576 |
-
[loc('
|
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': '
|
588 |
-
'first-line':
|
589 |
'folded-linenos': [],
|
590 |
-
'sel-line':
|
591 |
-
'sel-line-start':
|
592 |
-
'selection_end':
|
593 |
-
'selection_start':
|
594 |
'zoom': 0},
|
595 |
-
|
596 |
-
[loc('
|
597 |
-
{'attrib-starts': [
|
598 |
-
|
599 |
-
|
600 |
-
143)],
|
601 |
-
'code-line': ' raise exception_class(message, screen, stacktrace)\n',
|
602 |
-
'first-line': 209,
|
603 |
'folded-linenos': [],
|
604 |
-
'sel-line':
|
605 |
-
'sel-line-start':
|
606 |
-
'selection_end':
|
607 |
-
'selection_start':
|
608 |
'zoom': 0},
|
609 |
-
|
610 |
-
[loc('
|
611 |
{'attrib-starts': [],
|
612 |
-
'code-line': '
|
613 |
-
'first-line':
|
614 |
'folded-linenos': [],
|
615 |
-
'sel-line':
|
616 |
-
'sel-line-start':
|
617 |
-
'selection_end':
|
618 |
-
'selection_start':
|
619 |
'zoom': 0},
|
620 |
-
|
621 |
-
[loc('
|
622 |
-
{'attrib-starts': [
|
623 |
-
|
624 |
-
|
625 |
-
80)],
|
626 |
-
'code-line': ' raise TimeoutException(message, screen, stacktrace)\n',
|
627 |
-
'first-line': 82,
|
628 |
'folded-linenos': [],
|
629 |
-
'sel-line':
|
630 |
-
'sel-line-start':
|
631 |
-
'selection_end':
|
632 |
-
'selection_start':
|
633 |
'zoom': 0},
|
634 |
-
|
635 |
[loc('selenium_click.py'),
|
636 |
{'attrib-starts': [],
|
637 |
-
'code-line': '
|
638 |
'first-line': 0,
|
639 |
'folded-linenos': [],
|
640 |
'sel-line': 14,
|
641 |
-
'sel-line-start':
|
642 |
-
'selection_end':
|
643 |
-
'selection_start':
|
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 |
-
|
660 |
[loc('selenium_click.py'),
|
661 |
{'attrib-starts': [],
|
662 |
-
'code-line':
|
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 |
-
|
682 |
-
[loc('
|
683 |
-
{'attrib-starts': [('
|
684 |
-
|
685 |
-
'code-line':
|
686 |
-
'first-line':
|
687 |
'folded-linenos': [],
|
688 |
-
'sel-line':
|
689 |
-
'sel-line-start':
|
690 |
-
'selection_end':
|
691 |
-
'selection_start':
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
692 |
'zoom': 0},
|
693 |
-
|
694 |
20),
|
695 |
-
'current-loc': loc('
|
696 |
'editor-state-list': [(loc('app.py'),
|
697 |
-
{'attrib-starts': [('
|
698 |
-
|
699 |
-
'code-line':
|
700 |
-
'first-line':
|
701 |
'folded-linenos': [],
|
702 |
-
'sel-line':
|
703 |
-
'sel-line-start':
|
704 |
-
'selection_end':
|
705 |
-
'selection_start':
|
706 |
'zoom': 0}),
|
707 |
(loc('selenium_click.py'),
|
708 |
{'attrib-starts': [],
|
709 |
-
'code-line': ' \n',
|
710 |
-
'first-line':
|
711 |
'folded-linenos': [],
|
712 |
-
'sel-line':
|
713 |
-
'sel-line-start':
|
714 |
-
'selection_end':
|
715 |
-
'selection_start':
|
716 |
'zoom': 0})],
|
717 |
-
'has-focus':
|
718 |
'locked': False},
|
719 |
[loc('app.py'),
|
720 |
loc('selenium_click.py')]),
|
721 |
-
'open_files': ['
|
722 |
-
'
|
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 |
-
|
731 |
-
|
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 |
-
|
740 |
'user_data': {}},
|
741 |
'window-alloc': (0,
|
742 |
0,
|
743 |
1920,
|
744 |
-
|
745 |
-
guimgr.recent-documents = [loc('
|
746 |
-
loc('
|
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.'''))
|