-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.py
More file actions
67 lines (56 loc) · 2.52 KB
/
Copy pathconstants.py
File metadata and controls
67 lines (56 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
"""TranscribeX constants and data models."""
from __future__ import annotations
from dataclasses import dataclass
from typing import List, Optional
# ── App metadata ──────────────────────────────────────────────
APP_TITLE = "TranscribeX - Media to TXT/DOCX/SRT/VTT"
APP_VERSION = "1.2"
MIN_WIDTH = 760
# ── Transcription defaults ────────────────────────────────────
BEAM_SIZE = 5
BEST_OF = 5
VAD_MIN_SILENCE_MS = 500
# ── DOCX formatting ──────────────────────────────────────────
DOCX_META_FONT_SIZE_PT = 9
DOCX_PARAGRAPH_SPACING_PT = 6
# ── Dropdown options ─────────────────────────────────────────
MODEL_SIZES = ["tiny", "base", "small", "medium", "large-v3"]
COMPUTE_TYPES_GPU = ["int8", "int8_float16", "float16", "float32"]
COMPUTE_TYPES_CPU = ["int8", "float32"]
OUTPUT_FORMATS = ["txt", "docx", "srt", "vtt"]
LANGUAGES = [
"Auto-detect",
"en", "es", "fr", "de", "it", "pt", "nl", "ru", "zh",
"ja", "ko", "ar", "hi", "pl", "uk", "cs", "sv", "da",
"fi", "no", "tr", "vi", "th", "id", "ms", "he", "el",
"ro", "hu", "bg", "hr", "sk", "sl", "lt", "lv", "et",
"sr", "ca", "gl", "eu",
]
# ── File filters ─────────────────────────────────────────────
ALLOWED_EXTENSIONS = {
".mp3", ".mp4", ".m4a", ".wav", ".flac",
".aac", ".ogg", ".wma", ".mov", ".webm", ".mkv",
}
FILE_DIALOG_FILTER = (
"Media Files (*.mp3 *.mp4 *.m4a *.wav *.flac *.aac *.ogg *.wma *.mov *.webm *.mkv);;"
"All Files (*)"
)
# ── Batch warning threshold ──────────────────────────────────
LARGE_BATCH_THRESHOLD = 10
SLOW_MODELS = {"medium", "large-v3"}
# ── Defaults ─────────────────────────────────────────────────
DEFAULT_MODEL = "small"
DEFAULT_COMPUTE = "int8"
DEFAULT_FORMAT = "txt"
DEFAULT_LANGUAGE = "Auto-detect"
@dataclass
class TranscribeJob:
files: List[str]
out_dir: str
model_size: str
out_format: str
add_timestamps: bool
language: Optional[str]
compute_type: str
use_vad: bool
use_gpu: bool