Normalize transcription naming
This commit is contained in:
parent
3b7fa236b4
commit
b74aaaa1c4
5 changed files with 33 additions and 29 deletions
18
src/leld.py
18
src/leld.py
|
|
@ -11,7 +11,7 @@ from pathlib import Path
|
|||
|
||||
from config import Config, load, redacted_dict
|
||||
from recorder import start_recording, stop_recording
|
||||
from stt import FasterWhisperSTT, STTConfig
|
||||
from transcription import FasterWhisperTranscriber, TranscriptionConfig
|
||||
from aiprocess import AIConfig, build_processor
|
||||
from inject import inject
|
||||
from x11_hotkey import listen
|
||||
|
|
@ -34,11 +34,11 @@ class Daemon:
|
|||
self.proc = None
|
||||
self.record = None
|
||||
self.timer = None
|
||||
self.stt = FasterWhisperSTT(
|
||||
STTConfig(
|
||||
model=cfg.transcribing.get("model", "base"),
|
||||
self.transcriber = FasterWhisperTranscriber(
|
||||
TranscriptionConfig(
|
||||
model=cfg.transcription.get("model", "base"),
|
||||
language=None,
|
||||
device=cfg.transcribing.get("device", "cpu"),
|
||||
device=cfg.transcription.get("device", "cpu"),
|
||||
vad_filter=True,
|
||||
)
|
||||
)
|
||||
|
|
@ -117,10 +117,10 @@ class Daemon:
|
|||
|
||||
try:
|
||||
self.set_state(State.TRANSCRIBING)
|
||||
logging.info("transcribing started")
|
||||
text = self.stt.transcribe(record.wav_path, language="en")
|
||||
logging.info("transcription started")
|
||||
text = self.transcriber.transcribe(record.wav_path, language="en")
|
||||
except Exception as exc:
|
||||
logging.error("stt failed: %s", exc)
|
||||
logging.error("transcription failed: %s", exc)
|
||||
self.set_state(State.IDLE)
|
||||
return
|
||||
|
||||
|
|
@ -129,7 +129,7 @@ class Daemon:
|
|||
self.set_state(State.IDLE)
|
||||
return
|
||||
|
||||
logging.info("stt: %s", text)
|
||||
logging.info("transcription: %s", text)
|
||||
|
||||
ai_enabled = self.cfg.ai_cleanup.get("enabled", False)
|
||||
ai_prompt_file = ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue