github-actions[bot] commited on
Commit
aa3ab7e
Β·
1 Parent(s): 450750c

Auto-deploy from GitHub: 7d7ea68deaabe7026fbf5738ffdfbe29ae067235

Browse files
Files changed (3) hide show
  1. .gitattributes +1 -1
  2. index.html +191 -3
  3. tts_runner/engines/chatterbox.py +2 -1
.gitattributes CHANGED
@@ -1,5 +1,5 @@
1
- *.wav filter=lfs diff=lfs merge=lfs -text
2
  *.mp3 filter=lfs diff=lfs merge=lfs -text
3
  *.flac filter=lfs diff=lfs merge=lfs -text
4
  *.pth filter=lfs diff=lfs merge=lfs -text
5
  *.bin filter=lfs diff=lfs merge=lfs -text
 
 
 
1
  *.mp3 filter=lfs diff=lfs merge=lfs -text
2
  *.flac filter=lfs diff=lfs merge=lfs -text
3
  *.pth filter=lfs diff=lfs merge=lfs -text
4
  *.bin filter=lfs diff=lfs merge=lfs -text
5
+ *.wav filter=lfs diff=lfs merge=lfs -text
index.html CHANGED
@@ -487,6 +487,118 @@
487
  opacity: 0;
488
  }
489
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
490
  </style>
491
  </head>
492
 
@@ -671,6 +783,9 @@
671
  const response = await fetch(`${API_URL}/files`);
672
  const files = await response.json();
673
 
 
 
 
674
  const tbody = document.getElementById('filesTable');
675
 
676
  if (files.length === 0) {
@@ -678,14 +793,23 @@
678
  return;
679
  }
680
 
681
- tbody.innerHTML = files.map(file => {
 
 
 
 
682
  return `
683
  <tr>
684
- <td class="text-cell" title="${file.text}">${file.text}</td>
 
 
 
 
 
685
  <td><span class="status status-${file.status}">${file.status.replace('_', ' ')}</span></td>
686
  <td>
687
  ${file.status === 'completed' && file.output_file ?
688
- `<a href="${API_URL}/download/${file.id}" class="btn btn-small btn-secondary" target="_blank">⬇️ Download</a>`
689
  : 'β€”'}
690
  </td>
691
  <td>${new Date(file.created_at).toLocaleString()}</td>
@@ -727,6 +851,70 @@
727
  notification.remove();
728
  }, 4000);
729
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
730
  </script>
731
  </body>
732
 
 
487
  opacity: 0;
488
  }
489
  }
490
+
491
+ /* Text Popup Modal */
492
+ .text-modal-overlay {
493
+ position: fixed;
494
+ top: 0;
495
+ left: 0;
496
+ width: 100%;
497
+ height: 100%;
498
+ background: rgba(10, 14, 39, 0.95);
499
+ display: flex;
500
+ align-items: center;
501
+ justify-content: center;
502
+ z-index: 9999;
503
+ animation: fadeIn 0.3s ease;
504
+ padding: 2rem;
505
+ }
506
+
507
+ .text-modal {
508
+ background: var(--surface);
509
+ border: var(--border) solid var(--accent);
510
+ box-shadow: 8px 8px 0 var(--accent);
511
+ max-width: 800px;
512
+ width: 100%;
513
+ max-height: 80vh;
514
+ display: flex;
515
+ flex-direction: column;
516
+ animation: slideUp 0.3s ease;
517
+ }
518
+
519
+ .text-modal-header {
520
+ display: flex;
521
+ justify-content: space-between;
522
+ align-items: center;
523
+ padding: 1rem 1.5rem;
524
+ background: linear-gradient(135deg, var(--primary), var(--accent));
525
+ border-bottom: 3px solid var(--bg);
526
+ }
527
+
528
+ .text-modal-header h3 {
529
+ color: var(--bg);
530
+ font-weight: 900;
531
+ text-transform: uppercase;
532
+ letter-spacing: 1px;
533
+ }
534
+
535
+ .text-modal-close {
536
+ background: var(--bg);
537
+ border: 2px solid var(--bg);
538
+ color: var(--primary);
539
+ width: 36px;
540
+ height: 36px;
541
+ font-size: 1.2rem;
542
+ cursor: pointer;
543
+ display: flex;
544
+ align-items: center;
545
+ justify-content: center;
546
+ transition: all 0.2s ease;
547
+ }
548
+
549
+ .text-modal-close:hover {
550
+ background: var(--error);
551
+ color: var(--text);
552
+ }
553
+
554
+ .text-modal-content {
555
+ padding: 1.5rem;
556
+ overflow-y: auto;
557
+ flex: 1;
558
+ }
559
+
560
+ .text-modal-content pre {
561
+ white-space: pre-wrap;
562
+ word-wrap: break-word;
563
+ font-family: inherit;
564
+ font-size: 1rem;
565
+ line-height: 1.6;
566
+ color: var(--text);
567
+ margin: 0;
568
+ }
569
+
570
+ .text-modal-footer {
571
+ padding: 1rem 1.5rem;
572
+ border-top: 2px solid rgba(0, 212, 255, 0.2);
573
+ display: flex;
574
+ gap: 1rem;
575
+ justify-content: flex-end;
576
+ }
577
+
578
+ .btn-view-text {
579
+ background: var(--accent);
580
+ padding: 0.4rem 0.8rem;
581
+ font-size: 0.8rem;
582
+ box-shadow: 2px 2px 0 var(--bg);
583
+ }
584
+
585
+ .btn-view-text:hover {
586
+ transform: translate(-1px, -1px);
587
+ box-shadow: 3px 3px 0 var(--bg);
588
+ }
589
+
590
+ .text-cell-wrapper {
591
+ display: flex;
592
+ align-items: center;
593
+ gap: 0.5rem;
594
+ }
595
+
596
+ .text-cell-wrapper .text-preview {
597
+ max-width: 200px;
598
+ overflow: hidden;
599
+ text-overflow: ellipsis;
600
+ white-space: nowrap;
601
+ }
602
  </style>
603
  </head>
604
 
 
783
  const response = await fetch(`${API_URL}/files`);
784
  const files = await response.json();
785
 
786
+ // Store files data for popup access
787
+ filesData = files;
788
+
789
  const tbody = document.getElementById('filesTable');
790
 
791
  if (files.length === 0) {
 
793
  return;
794
  }
795
 
796
+ tbody.innerHTML = files.map((file, index) => {
797
+ // Escape text for HTML attribute and display
798
+ const escapedText = escapeHtml(file.text);
799
+ const truncatedText = file.text.length > 50 ? file.text.substring(0, 50) + '...' : file.text;
800
+
801
  return `
802
  <tr>
803
+ <td>
804
+ <div class="text-cell-wrapper">
805
+ <span class="text-preview" title="${escapedText}">${escapeHtml(truncatedText)}</span>
806
+ <button class="btn btn-small btn-view-text" onclick="showTextPopup(${index})">πŸ‘οΈ View</button>
807
+ </div>
808
+ </td>
809
  <td><span class="status status-${file.status}">${file.status.replace('_', ' ')}</span></td>
810
  <td>
811
  ${file.status === 'completed' && file.output_file ?
812
+ `<a href="${API_URL}/download/${file.id}" class="btn btn-small btn-secondary" target="_blank">⬇️</a>`
813
  : 'β€”'}
814
  </td>
815
  <td>${new Date(file.created_at).toLocaleString()}</td>
 
851
  notification.remove();
852
  }, 4000);
853
  }
854
+
855
+ // Store files data for popup access
856
+ let filesData = [];
857
+
858
+ // Escape HTML to prevent XSS
859
+ function escapeHtml(text) {
860
+ const div = document.createElement('div');
861
+ div.textContent = text;
862
+ return div.innerHTML;
863
+ }
864
+
865
+ // Show text popup
866
+ function showTextPopup(index) {
867
+ const file = filesData[index];
868
+ if (!file) return;
869
+
870
+ // Create modal overlay
871
+ const overlay = document.createElement('div');
872
+ overlay.className = 'text-modal-overlay';
873
+ overlay.onclick = (e) => {
874
+ if (e.target === overlay) overlay.remove();
875
+ };
876
+
877
+ // Create modal content
878
+ overlay.innerHTML = `
879
+ <div class="text-modal">
880
+ <div class="text-modal-header">
881
+ <h3>πŸ“ Full Text</h3>
882
+ <button class="text-modal-close" onclick="this.closest('.text-modal-overlay').remove()">βœ•</button>
883
+ </div>
884
+ <div class="text-modal-content">
885
+ <pre>${escapeHtml(file.text)}</pre>
886
+ </div>
887
+ <div class="text-modal-footer">
888
+ <button class="btn btn-small btn-secondary" onclick="copyTextToClipboard(${index})">πŸ“‹ Copy Text</button>
889
+ <button class="btn btn-small" onclick="this.closest('.text-modal-overlay').remove()">Close</button>
890
+ </div>
891
+ </div>
892
+ `;
893
+
894
+ document.body.appendChild(overlay);
895
+
896
+ // Close on Escape key
897
+ const handleEscape = (e) => {
898
+ if (e.key === 'Escape') {
899
+ overlay.remove();
900
+ document.removeEventListener('keydown', handleEscape);
901
+ }
902
+ };
903
+ document.addEventListener('keydown', handleEscape);
904
+ }
905
+
906
+ // Copy text to clipboard
907
+ function copyTextToClipboard(index) {
908
+ const file = filesData[index];
909
+ if (!file) return;
910
+
911
+ navigator.clipboard.writeText(file.text).then(() => {
912
+ showNotification('Text copied to clipboard! πŸ“‹');
913
+ }).catch((err) => {
914
+ console.error('Failed to copy:', err);
915
+ showNotification('Failed to copy text', 'error');
916
+ });
917
+ }
918
  </script>
919
  </body>
920
 
tts_runner/engines/chatterbox.py CHANGED
@@ -96,7 +96,8 @@ class ChatterboxTTSProcessor(BaseTTS):
96
  temp_chunk = word
97
 
98
  if temp_chunk:
99
- current = temp_chunk.strip()
 
100
  continue
101
 
102
  # Try adding sentence to current chunk
 
96
  temp_chunk = word
97
 
98
  if temp_chunk:
99
+ chunks.append(temp_chunk.strip())
100
+ current = ""
101
  continue
102
 
103
  # Try adding sentence to current chunk