diff options
| author | yum <yum.food.vr@gmail.com> | 2025-05-29 19:45:48 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-05-29 19:45:48 -0700 |
| commit | f97cef182de55b6dbae8d2bc0477acfca6cc1f66 (patch) | |
| tree | 61c9237fb404dcb9749a496be57e6758e7341c2a /app/hi.py | |
| parent | 82a5b3805b2a54faea501ee362419330664c277a (diff) | |
More UI work
1. main STT app works in new project structure
2. UI dumps mics on startup to populate mic list
3. add missing deps (hf-xet, wave)
4. normalize audio volume when transcribing. Probably still wrong tbqh.
5. add checkbox to save audio segments & improve logic so only segments
with speech get saved.
6. add default config settings
Diffstat (limited to 'app/hi.py')
| -rw-r--r-- | app/hi.py | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -2,6 +2,7 @@ import app_config import argparse from math import floor, ceil import msvcrt +import os from pythonosc import udp_client import sentencepiece as spm from shared_thread_data import SharedThreadData @@ -15,8 +16,11 @@ TESTS_ENABLED = True # 0 = quiet, 1 = verbose, 2 = very verbose LOG_LEVEL = 0 +APP_ROOT = os.path.dirname(os.path.abspath(__file__)) +PROJECT_ROOT = os.path.dirname(APP_ROOT) + def get_tokenizer(): - model_path = "./custom_unigram_tokenizer_65k/unigram.model" + model_path = os.path.join(PROJECT_ROOT, "custom_unigram_tokenizer_65k", "unigram.model") print(f"Loading SentencePiece tokenizer from: {model_path}") sp = spm.SentencePieceProcessor() sp.load(model_path) @@ -346,7 +350,6 @@ if __name__ == "__main__": time.sleep(0.1) continue - try: char = char_bytes.decode('utf-8') if char == '\r' or char == '\n': |
