fix: Seed-X 프롬프트 형식과 티어별 용어집 전략 수정
4티어(Seed-X-PPO-7B) 번역 경로가 모델 카드 요구사항을 어기고 있었다. - 프롬프트 끝의 `<ko>` 등 대상 언어 태그가 빠져 있었다. PPO 학습에 쓰인 신호라 없으면 번역 품질이 흔들린다. - Seed-X 는 chat template 없는 번역 전용 completion 모델인데 "구어체로 자연스럽게" 같은 지시문 래퍼를 씌우고 있었다. 학습 분포를 벗어난다. - 그 결과 MTSpec.supports_prompt_glossary=True 가 사실과 달랐다. Seed-X 는 용어집 지시문을 이해하지 못하므로 플레이스홀더 치환을 써야 한다. 수정 - PromptStyle(NONE/SEEDX/INSTRUCT) 도입, supports_prompt_glossary 를 prompt_style 에서 파생시켜 둘이 어긋날 수 없게 함 - build_seedx_prompt() 로 모델 카드 형식을 분리 (지시문 주입 불가) - INSTRUCT 경로는 chat template 사용, Qwen3 thinking 모드는 끔 - LANGUAGES 에 seedx 태그 명시 - finetune_mt.py 가 티어의 prompt_style 을 따라가게 해 학습/추론 프롬프트 일치 - AWQ Int4 로드 실패 시 autoawq 설치 안내를 담은 오류 메시지 검증: pytest 52개 통과 (프롬프트 회귀 테스트 13개 추가), ruff clean 근거: https://huggingface.co/ByteDance-Seed/Seed-X-PPO-7B Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
from hearo.models.tiers import DEFAULT_TIER, TIERS, MTBackend, get_tier, ordered_tiers
|
||||
from hearo.models.tiers import (
|
||||
DEFAULT_TIER,
|
||||
TIERS,
|
||||
MTBackend,
|
||||
PromptStyle,
|
||||
get_tier,
|
||||
ordered_tiers,
|
||||
)
|
||||
|
||||
|
||||
def test_exactly_five_tiers_ordered_by_quality():
|
||||
@@ -20,12 +27,20 @@ def test_exactly_one_recommended_and_one_finetune_pick():
|
||||
assert sum(t.best_after_finetune for t in TIERS.values()) == 1
|
||||
|
||||
|
||||
def test_llm_backends_support_prompt_glossary():
|
||||
def test_only_instruct_models_support_prompt_glossary():
|
||||
"""LLM이라고 다 되는 게 아니다 — 지시문을 이해하는 instruct 모델만 가능하다.
|
||||
|
||||
Seed-X 는 번역 전용 completion 모델이라 지시문을 넣으면 오히려 망가진다.
|
||||
"""
|
||||
for tier in TIERS.values():
|
||||
if tier.mt.backend is MTBackend.TRANSFORMERS:
|
||||
assert tier.mt.supports_prompt_glossary
|
||||
else:
|
||||
assert not tier.mt.supports_prompt_glossary
|
||||
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():
|
||||
|
||||
Reference in New Issue
Block a user