Skip to content

Commit a3a2fbd

Browse files
committed
Fix Panopto 404, broaden CUDA/Python compatibility (v0.7.10)
- Panopto URL: fix 404 by using tag v1.4.3 zip (repo uses 'master' not 'main') - Python compatibility: add 'from __future__ import annotations' to extract_caption.py so X|None type hints work on Python 3.8/3.9 - CUDA 11.8 support: add cu118 index URL for older enterprise machines; CUDA < 11.8 now falls back to CPU build instead of using old cu121 wheel - Torch resilience: if GPU torch install fails (e.g. incompatible GLIBC), automatically retry with plain CPU build instead of aborting the install
1 parent 90cf384 commit a3a2fbd

3 files changed

Lines changed: 19 additions & 6 deletions

File tree

‎electron/main.js‎

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const ML_PACKAGES = [
6060
// • On Linux AppImage: avoids system git, which fails when the AppImage's
6161
// bundled libssl.so.3 pollutes LD_LIBRARY_PATH and breaks libcurl
6262
// pip downloads the zip using its own HTTP client (Python ssl), not libcurl.
63-
const PANOPTO_PKG = 'https://github.com/Panopto-Video-DL/Panopto-Video-DL-lib/archive/refs/heads/main.zip';
63+
const PANOPTO_PKG = 'https://github.com/Panopto-Video-DL/Panopto-Video-DL-lib/archive/refs/tags/v1.4.3.zip';
6464

6565
// ── Config helpers ────────────────────────────────────────────────────────────
6666
function ensureDataDir() {
@@ -340,11 +340,15 @@ function detectCuda() {
340340

341341
function torchIndexUrl(cuda) {
342342
if (!cuda) return null;
343-
const v = cuda[0] * 10 + cuda[1];
343+
const [major, minor] = cuda;
344+
const v = major * 10 + minor;
344345
if (v >= 128) return 'https://download.pytorch.org/whl/cu128';
345346
if (v >= 126) return 'https://download.pytorch.org/whl/cu126';
346347
if (v >= 124) return 'https://download.pytorch.org/whl/cu124';
347-
return 'https://download.pytorch.org/whl/cu121';
348+
if (v >= 121) return 'https://download.pytorch.org/whl/cu121';
349+
if (v >= 118) return 'https://download.pytorch.org/whl/cu118';
350+
// CUDA < 11.8: too old for torch 2.x; fall back to CPU build
351+
return null;
348352
}
349353

350354
// ── Active process state ──────────────────────────────────────────────────────
@@ -513,15 +517,22 @@ async function runInstaller(basePython, sendLog, sendDone) {
513517
// Step 3 — detect CUDA and install torch
514518
const cuda = detectCuda();
515519
const idxUrl = torchIndexUrl(cuda);
516-
if (cuda) {
520+
if (cuda && idxUrl) {
517521
sendLog(`► CUDA ${cuda[0]}.${cuda[1]} detected — installing torch (GPU)…\n`);
522+
} else if (cuda) {
523+
sendLog(`► CUDA ${cuda[0]}.${cuda[1]} detected but too old for GPU torch — installing CPU build…\n`);
518524
} else {
519525
sendLog('► No GPU detected — installing torch (CPU)…\n');
520526
}
521527
const torchArgs = idxUrl
522528
? ['install', 'torch', '--index-url', idxUrl]
523529
: ['install', 'torch'];
524-
const torchCode = await runStep(pip, torchArgs);
530+
let torchCode = await runStep(pip, torchArgs);
531+
if (torchCode !== 0 && idxUrl) {
532+
// GPU wheel failed (e.g. incompatible GLIBC) — retry with plain CPU build
533+
sendLog('WARNING: GPU torch install failed — retrying with CPU-only build…\n');
534+
torchCode = await runStep(pip, ['install', 'torch']);
535+
}
525536
if (torchCode !== 0) {
526537
sendLog('ERROR: torch installation failed (see log above).\n');
527538
sendDone({ success: false, error: 'torch install failed' });

‎electron/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "auto-note",
3-
"version": "0.7.9",
3+
"version": "0.7.10",
44
"description": "AutoNote — lecture notes generator from Canvas recordings",
55
"main": "main.js",
66
"scripts": {

‎extract_caption.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
python extract_caption.py --video PATH # process a single video file
1515
"""
1616

17+
from __future__ import annotations
18+
1719
import gc
1820
import json
1921
import os

0 commit comments

Comments
 (0)