v3.1.3: Fix SPA redeclaration errors, update docker-compose for cookies
Some checks failed
Docker Build & Push / build (push) Has been cancelled
Some checks failed
Docker Build & Push / build (push) Has been cancelled
This commit is contained in:
parent
663ef6ba44
commit
79f69772a0
3 changed files with 304 additions and 295 deletions
|
|
@ -14,11 +14,14 @@ services:
|
|||
volumes:
|
||||
# Persist data (Easy setup: Just maps a folder)
|
||||
- ./data:/app/data
|
||||
# Cookies file for YouTube (Required for NAS/Server to fix "Transcript not available")
|
||||
- ./data/cookies.txt:/app/cookies.txt
|
||||
# Local videos folder (Optional)
|
||||
# - ./videos:/app/youtube_downloads
|
||||
environment:
|
||||
- PYTHONUNBUFFERED=1
|
||||
- FLASK_ENV=production
|
||||
- COOKIES_FILE=/app/cookies.txt
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "-f", "http://localhost:5000/" ]
|
||||
interval: 30s
|
||||
|
|
|
|||
5
static/js/webllm-service.js
Normal file → Executable file
5
static/js/webllm-service.js
Normal file → Executable file
|
|
@ -3,6 +3,9 @@
|
|||
* Uses MLC's WebLLM for on-device AI inference via WebGPU
|
||||
*/
|
||||
|
||||
// Guard against redeclaration on SPA navigation
|
||||
if (typeof WebLLMService === 'undefined') {
|
||||
|
||||
class WebLLMService {
|
||||
constructor() {
|
||||
this.engine = null;
|
||||
|
|
@ -338,3 +341,5 @@ window.webLLMService = new WebLLMService();
|
|||
if (typeof module !== 'undefined' && module.exports) {
|
||||
module.exports = WebLLMService;
|
||||
}
|
||||
|
||||
} // End guard block for WebLLMService
|
||||
|
|
|
|||
|
|
@ -1703,10 +1703,11 @@
|
|||
|
||||
<script>
|
||||
// Track current language state and WebLLM status
|
||||
let currentSummaryLang = 'en';
|
||||
let webllmInitialized = false;
|
||||
let currentTranscriptText = null;
|
||||
let currentSummaryData = { en: null, vi: null };
|
||||
// Use var and guards to prevent redeclaration errors on SPA navigation
|
||||
if (typeof currentSummaryLang === 'undefined') var currentSummaryLang = 'en';
|
||||
if (typeof webllmInitialized === 'undefined') var webllmInitialized = false;
|
||||
if (typeof currentTranscriptText === 'undefined') var currentTranscriptText = null;
|
||||
if (typeof currentSummaryData === 'undefined') var currentSummaryData = { en: null, vi: null };
|
||||
|
||||
// WebLLM Progress Update Handler - Silent loading (just log to console)
|
||||
function updateWebLLMProgress(percent, status) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue