이름을 Hearo → LiveSub 로 변경. 말장난보다 하는 일이 바로 보이는 쪽이 낫다. 자막 on/off - 전역 단축키 Ctrl+Alt+S (자막) / Ctrl+Alt+D (번역) — Windows RegisterHotKey + 네이티브 이벤트 필터라 게임 창이 떠 있어도 동작. 다른 OS 에서는 no-op - 단축키·체크박스·우클릭 메뉴가 모두 같은 경로를 타도록 통합 모니터 선택 + 디스코드식 배치 - placement.py: Qt 비의존 배치 계산 (모니터 목록 → 9분할 좌표) - AnchorGrid 위젯으로 3x3 위치 선택, 드래그하면 자유 배치로 전환 - 모니터 구성이 바뀌어도 자막이 화면 밖으로 사라지지 않도록 클램프 GPU 저부하 모드 (기본 켜짐) - 연산 정밀도 int8 강등, VRAM 상한 35%, 추론 후 60ms 양보, 300초 무음 시 모델 언로드, 중간 결과 비활성 - 기본 티어를 균형(6GB) → 신속(4GB) 으로 하향 - 8GB GPU 기준 자막 2.8GB / 게임 5.2GB 게임 용어집 번들 (304개) - 롤 74 · 발로란트 59 · 오버워치2 49 · FPS공통 46 · 마크 38 · 방송 38 - 체크박스로 켜고 끄며, 사용자가 직접 등록한 항목이 항상 우선 검증: pytest 91개 통과 (배치 14 + 팩 12 + UI 6 신규), ruff clean Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
52 lines
1.5 KiB
Python
52 lines
1.5 KiB
Python
from livesub.models.tiers import (
|
|
DEFAULT_TIER,
|
|
TIERS,
|
|
MTBackend,
|
|
PromptStyle,
|
|
get_tier,
|
|
ordered_tiers,
|
|
)
|
|
|
|
|
|
def test_exactly_five_tiers_ordered_by_quality():
|
|
tiers = ordered_tiers()
|
|
assert len(tiers) == 5
|
|
assert [t.order for t in tiers] == [1, 2, 3, 4, 5]
|
|
|
|
|
|
def test_latency_and_vram_increase_monotonically():
|
|
tiers = ordered_tiers()
|
|
latencies = [t.approx_latency_s for t in tiers]
|
|
vram = [t.min_vram_gb for t in tiers]
|
|
assert latencies == sorted(latencies)
|
|
assert vram == sorted(vram)
|
|
|
|
|
|
def test_exactly_one_recommended_and_one_finetune_pick():
|
|
assert sum(t.recommended for t in TIERS.values()) == 1
|
|
assert sum(t.best_after_finetune for t in TIERS.values()) == 1
|
|
|
|
|
|
def test_only_instruct_models_support_prompt_glossary():
|
|
"""LLM이라고 다 되는 게 아니다 — 지시문을 이해하는 instruct 모델만 가능하다.
|
|
|
|
Seed-X 는 번역 전용 completion 모델이라 지시문을 넣으면 오히려 망가진다.
|
|
"""
|
|
for tier in TIERS.values():
|
|
expected = tier.mt.prompt_style is PromptStyle.INSTRUCT
|
|
assert tier.mt.supports_prompt_glossary is expected, tier.key
|
|
|
|
|
|
def test_seq2seq_backends_have_no_prompt_style():
|
|
for tier in TIERS.values():
|
|
if tier.mt.backend is MTBackend.CTRANSLATE2:
|
|
assert tier.mt.prompt_style is PromptStyle.NONE, tier.key
|
|
|
|
|
|
def test_unknown_key_falls_back_to_default():
|
|
assert get_tier("does-not-exist").key == DEFAULT_TIER
|
|
|
|
|
|
def test_default_tier_exists():
|
|
assert DEFAULT_TIER in TIERS
|