From ee31d26116046318bf8b5790170af3158505d0e1 Mon Sep 17 00:00:00 2001 From: Azeufack Noupeu Willy Date: Thu, 11 Dec 2025 14:52:48 +0100 Subject: [PATCH 01/60] Implemented local Parakeet transcription module (S4-07) --- .../modules/transcription-local/parakeet.js | 54 ++++++++++++++ .../parakeet_transcribe.py | 71 +++++++++++++++++++ 2 files changed, 125 insertions(+) create mode 100644 services/modules/transcription-local/parakeet.js create mode 100644 services/modules/transcription-local/parakeet_transcribe.py diff --git a/services/modules/transcription-local/parakeet.js b/services/modules/transcription-local/parakeet.js new file mode 100644 index 0000000..10c95e0 --- /dev/null +++ b/services/modules/transcription-local/parakeet.js @@ -0,0 +1,54 @@ +// ----------------------------------------------------------- +// Parakeet (Step 3A: spawn Python minimal integration) +// ----------------------------------------------------------- + +const fs = require("fs"); +const path = require("path"); +const { spawn } = require("child_process"); + +module.exports = { + name: "parakeet", + type: "transcription", + displayname: "NVIDIA Parakeet", + + async function(audioFilePath) { + console.log("🦜 [Parakeet] Starting test integration (spawn only)..."); + console.log("🦜 Input audio:", audioFilePath); + + // Check audio exists + if (!fs.existsSync(audioFilePath)) { + throw new Error("Audio file does not exist: " + audioFilePath); + } + + // Output path in storage/transcripts + const sessionId = path.basename(audioFilePath).replace(/\.[^.]+$/, ""); + const outputDir = path.join(__dirname, "../../../storage/transcripts"); + fs.mkdirSync(outputDir, { recursive: true }); + + const outputPath = path.join(outputDir, `${sessionId}.json`); + + // ------------------------------------------------------- + // SPAWN PYTHON SCRIPT (step 3A — dummy script) + // ------------------------------------------------------- + return new Promise((resolve, reject) => { + const python310 = "C:\\Users\\smith\\AppData\\Local\\Programs\\Python\\Python310\\python.exe"; + const py = spawn(python310, [ + path.join(__dirname, "parakeet_transcribe.py"), + audioFilePath, + outputPath + ]); + + py.stdout.on("data", data => console.log("🦜 [Python]", data.toString().trim())); + py.stderr.on("data", data => console.error("🦜 [Python ERR]", data.toString().trim())); + + py.on("close", code => { + if (code === 0) { + console.log("🦜 [Parakeet] Done (spawn test). Output:", outputPath); + resolve(outputPath); + } else { + reject(new Error("Python script failed with exit code " + code)); + } + }); + }); + } +}; diff --git a/services/modules/transcription-local/parakeet_transcribe.py b/services/modules/transcription-local/parakeet_transcribe.py new file mode 100644 index 0000000..1272e46 --- /dev/null +++ b/services/modules/transcription-local/parakeet_transcribe.py @@ -0,0 +1,71 @@ +# ----------------------------------------------------------- +# Parakeet Real Transcriber (NVIDIA NeMo + PyTorch GPU) +# ----------------------------------------------------------- + +import sys +import json +import soundfile as sf +import torch +from nemo.collections.asr.models import ASRModel + +# Args: +# sys.argv[1] = input audio path +# sys.argv[2] = output JSON path + +audio_path = sys.argv[1] +output_path = sys.argv[2] + +print("🔥 Starting Parakeet model...") +device = "cuda" if torch.cuda.is_available() else "cpu" +print("🔥 Using device:", device) + +# ----------------------------------------------------------- +# Load Parakeet model (NVIDIA pretrained ASR) +# ----------------------------------------------------------- +model = ASRModel.from_pretrained(model_name="nvidia/parakeet-ctc-0.6b") +model = model.to(device) +model.eval() + +# ----------------------------------------------------------- +# Load audio +# ----------------------------------------------------------- +print("🎧 Loading audio:", audio_path) +audio, sr = sf.read(audio_path) + +# model expects mono float32 +if len(audio.shape) > 1: + audio = audio.mean(axis=1) + +audio = audio.astype("float32") + +# ----------------------------------------------------------- +# Run inference +# ----------------------------------------------------------- +print("🧠 Running inference...") +with torch.no_grad(): + hyp = model.transcribe([audio])[0] + +# Extract only the text +if hasattr(hyp, "text"): + transcript = hyp.text +else: + # fallback: convert to string (rare) + transcript = str(hyp) + +print("📄 Transcript:", transcript) + +# ----------------------------------------------------------- +# Save JSON format compatible with V2D pipeline +# ----------------------------------------------------------- +result = { + "id": output_path.split("/")[-1].replace(".json", ""), + "tool": "nemo_parakeet", + "status": "completed", + "text": transcript, + "words": [] # Parakeet XS doesn’t return word timestamps +} + +with open(output_path, "w", encoding="utf-8") as f: + json.dump(result, f, indent=2, ensure_ascii=False) + +print("✔ JSON saved at:", output_path) From 9c156a7df3d1e6c2d0c24b440ff0b204d8996946 Mon Sep 17 00:00:00 2001 From: MikeHughes-BIN Date: Tue, 23 Dec 2025 13:48:27 +0100 Subject: [PATCH 02/60] env example is in UTF 16 which, when copied and used as the .env, is unreadable and breaks the Programm --- .DS_Store | Bin 0 -> 6148 bytes .env.example | Bin 106 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 .DS_Store delete mode 100644 .env.example diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0<#0094+5a<8^ From f5c2e2700bd25721af0c10c71d3d25b0b7d9755f Mon Sep 17 00:00:00 2001 From: Verena Schulz Date: Tue, 30 Dec 2025 16:53:25 +0100 Subject: [PATCH 03/60] Added headings, some finetuning --- electron/main/index.html | 7 ++++++- electron/main/style.css | 12 ++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/electron/main/index.html b/electron/main/index.html index 6d045ab..c35aadb 100644 --- a/electron/main/index.html +++ b/electron/main/index.html @@ -43,6 +43,7 @@
+

Upload your Video here:

Drag and drop video file