dev-strender Claude Opus 4.7 (1M context) commited on
Commit
aa11860
ยท
1 Parent(s): f338c84

refactor: drop category selector from title proofreading tab

Browse files

Both pro2 and pro3 outputs were observed to behave the same regardless
of selected category, so the selector added no informational value.
Internally uses fixed "์ผ๋ฐ˜๊ธฐ์‚ฌ" so the existing user template and
system prompt stay unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Files changed (1) hide show
  1. title_proofread/ui.py +9 -18
title_proofread/ui.py CHANGED
@@ -15,7 +15,9 @@ from diff_utils import highlight_diff
15
 
16
  from .runner import MODELS, load_default_prompts, run_title_proofread
17
 
18
- CATEGORY_CHOICES = ["์ผ๋ฐ˜๊ธฐ์‚ฌ", "์นผ๋Ÿผ"]
 
 
19
 
20
 
21
  def build_title_proofread_tab(client: Any) -> None:
@@ -32,19 +34,11 @@ def build_title_proofread_tab(client: Any) -> None:
32
  f"ํ•œ๊ตญ ์‹ ๋ฌธ ์ œ๋ชฉ ๊ต์—ด ๊ฒฐ๊ณผ๋ฅผ `{MODELS[0]}` ์™€ `{MODELS[1]}` ๋‘ ๋ชจ๋ธ๋กœ ๋น„๊ต."
33
  )
34
 
35
- with gr.Row():
36
- with gr.Column(scale=1):
37
- category = gr.Dropdown(
38
- label="์นดํ…Œ๊ณ ๋ฆฌ",
39
- choices=CATEGORY_CHOICES,
40
- value="์ผ๋ฐ˜๊ธฐ์‚ฌ",
41
- )
42
- with gr.Column(scale=4):
43
- original = gr.Textbox(
44
- label="์ œ๋ชฉ ์ž…๋ ฅ",
45
- placeholder="์˜ˆ: ๊ฐ•๋‚จ 3๊ตฌ, ๋งค๋ฌผ 30% ๋Š˜์—ˆ์ง€๋งŒ ๊ฑฐ๋ž˜๋Ÿ‰ 15% ์ค„์–ด์œ ",
46
- lines=1,
47
- )
48
 
49
  with gr.Accordion("์ถ”๋ก  ์˜ต์…˜ (์–‘์ชฝ ๋ชจ๋ธ ๊ณตํ†ต ์ ์šฉ)", open=False):
50
  with gr.Row():
@@ -88,7 +82,6 @@ def build_title_proofread_tab(client: Any) -> None:
88
 
89
  def _on_run(
90
  original_text: str,
91
- category_value: str,
92
  temperature_val: float,
93
  reasoning_effort_val: str,
94
  ):
@@ -100,7 +93,6 @@ def build_title_proofread_tab(client: Any) -> None:
100
  return _empty()
101
 
102
  orig_clean = original_text.strip()
103
- category_clean = (category_value or "์ผ๋ฐ˜๊ธฐ์‚ฌ").strip()
104
 
105
  # ๋‘ ๋ชจ๋ธ ๋ณ‘๋ ฌ ํ˜ธ์ถœ (์ด latency = max(pro2, pro3)).
106
  # ์‹œ์Šคํ…œยท์œ ์ € ํ”„๋กฌํ”„ํŠธ๋Š” ๋‚ด๋ถ€ default ๊ณ ์ • โ€” UI ์— ๋…ธ์ถœํ•˜์ง€ ์•Š์Œ.
@@ -110,7 +102,7 @@ def build_title_proofread_tab(client: Any) -> None:
110
  run_title_proofread,
111
  client=client,
112
  original=orig_clean,
113
- category=category_clean,
114
  system_prompt=default_system,
115
  user_template=default_user,
116
  model=m,
@@ -143,7 +135,6 @@ def build_title_proofread_tab(client: Any) -> None:
143
  _on_run,
144
  inputs=[
145
  original,
146
- category,
147
  temperature,
148
  reasoning_effort,
149
  ],
 
15
 
16
  from .runner import MODELS, load_default_prompts, run_title_proofread
17
 
18
+ # UI ๋‹จ์ˆœํ™”๋ฅผ ์œ„ํ•ด category ๋Š” ์ž…๋ ฅ ๋ฐ›์ง€ ์•Š๊ณ  ๋‚ด๋ถ€ ๊ณ ์ •.
19
+ # ๋ชจ๋ธ ๊ฑฐ๋™์ƒ ์นดํ…Œ๊ณ ๋ฆฌ๋ณ„๋กœ ์˜๋ฏธ ์žˆ๋Š” ์ฐจ์ด๊ฐ€ ๊ด€์ฐฐ๋˜์ง€ ์•Š์•„ ์„ ํƒ UI ์ œ๊ฑฐ.
20
+ DEFAULT_CATEGORY = "์ผ๋ฐ˜๊ธฐ์‚ฌ"
21
 
22
 
23
  def build_title_proofread_tab(client: Any) -> None:
 
34
  f"ํ•œ๊ตญ ์‹ ๋ฌธ ์ œ๋ชฉ ๊ต์—ด ๊ฒฐ๊ณผ๋ฅผ `{MODELS[0]}` ์™€ `{MODELS[1]}` ๋‘ ๋ชจ๋ธ๋กœ ๋น„๊ต."
35
  )
36
 
37
+ original = gr.Textbox(
38
+ label="์ œ๋ชฉ ์ž…๋ ฅ",
39
+ placeholder="์˜ˆ: ๊ฐ•๋‚จ 3๊ตฌ, ๋งค๋ฌผ 30% ๋Š˜์—ˆ์ง€๋งŒ ๊ฑฐ๋ž˜๋Ÿ‰ 15% ์ค„์–ด์œ ",
40
+ lines=1,
41
+ )
 
 
 
 
 
 
 
 
42
 
43
  with gr.Accordion("์ถ”๋ก  ์˜ต์…˜ (์–‘์ชฝ ๋ชจ๋ธ ๊ณตํ†ต ์ ์šฉ)", open=False):
44
  with gr.Row():
 
82
 
83
  def _on_run(
84
  original_text: str,
 
85
  temperature_val: float,
86
  reasoning_effort_val: str,
87
  ):
 
93
  return _empty()
94
 
95
  orig_clean = original_text.strip()
 
96
 
97
  # ๋‘ ๋ชจ๋ธ ๋ณ‘๋ ฌ ํ˜ธ์ถœ (์ด latency = max(pro2, pro3)).
98
  # ์‹œ์Šคํ…œยท์œ ์ € ํ”„๋กฌํ”„ํŠธ๋Š” ๋‚ด๋ถ€ default ๊ณ ์ • โ€” UI ์— ๋…ธ์ถœํ•˜์ง€ ์•Š์Œ.
 
102
  run_title_proofread,
103
  client=client,
104
  original=orig_clean,
105
+ category=DEFAULT_CATEGORY,
106
  system_prompt=default_system,
107
  user_template=default_user,
108
  model=m,
 
135
  _on_run,
136
  inputs=[
137
  original,
 
138
  temperature,
139
  reasoning_effort,
140
  ],