Spaces:
Running
Running
Update app.py
Browse files120 unmodified lines121122123124125126127128129130131132133134135238 unmodified lines374375376377378379380120 unmodified lineshtml_parts.append(f'<span style="background-color: #ffe066; font-weight: bold; padding: 2px; border-radius: 3px; color: #000;">{chunk}</span>')raw_html = "".join(html_parts)raw_html = re.sub(r'(@@[^\s<]+)', r'<span style="background-color: #ff4d4d; color: white; font-weight: bold; padding: 2px 6px; border-radius: 4px; box-shadow: 0 0 5px #ff4d4d;">\1</span>', raw_html)html_output = f'<div id="prompter_label_space">๐บ ํ๋กฌํํฐ ๋ทฐ (๋ณ๊ฒฝ์ ํ์ธ)</div><div id="prompter_output_div" style="font-size:{font_size}px;">{raw_html}</div>'# โ ์๋ก ์ถ๊ฐ๋ ๋ถ๋ถ: @@ ๋ง์ปค ์ถ์ถํด์ ๋ชจ์๋ณด๊ธฐ# ํ๊ธ, ์๋ฌธ, ์ซ์๋ก ์ด๋ฃจ์ด์ง ๋จ์ด๋ง ๊น๋ํ๊ฒ ์ถ์ถ (๊ตฌ๋์ ์ ์ธ)markers = re.findall(r'@@([๊ฐ-ํฃa-zA-Z0-9]+)', input_text)unique_markers = list(dict.fromkeys(markers)) # ์ค๋ณต ์ ๊ฑฐif unique_markers:marker_result = " / ".join(unique_markers)else:238 unmodified lineswith gr.Accordion("๐ ์์ ํ ์คํธ ๊ฒฐ๊ณผ (๋ณต์ฌ์ฉ) - ํด๋ฆญํด์ ํผ์น๊ธฐ", open=False):output_text = gr.Textbox(lines=8, show_label=False, show_copy_button=True, elem_id="output_text_area")# โ ์๋ก ์ถ๊ฐ๋ ๋ง์ปค ๋ชจ์๋ณด๊ธฐ ์ฐฝ!marker_collection = gr.Textbox(label="๐จ ์์ ํ์ ๋จ์ด ๋ชจ์๋ณด๊ธฐ (@@)", interactive=False, lines=2)gr.Markdown("---")120 unmodified lines121122123124125126127128129130131132133134135136137138139140238 unmodified lines379380381382383384385120 unmodified lineshtml_parts.append(f'<span style="background-color: #ffe066; font-weight: bold; padding: 2px; border-radius: 3px; color: #000;">{chunk}</span>')raw_html = "".join(html_parts)# โ ์์ ๋จ: ์/๋ค ์ด๋์ ์๋ @@๊ฐ ํฌํจ๋ ์ด์ ์ ์ฒด๋ฅผ ๋นจ๊ฐ์์ผ๋ก ํ์ด๋ผ์ดํธraw_html = re.sub(r'([^\s<]*@@[^\s<]*)', r'<span style="background-color: #ff4d4d; color: white; font-weight: bold; padding: 2px 6px; border-radius: 4px; box-shadow: 0 0 5px #ff4d4d;">\1</span>', raw_html)html_output = f'<div id="prompter_label_space">๐บ ํ๋กฌํํฐ ๋ทฐ (๋ณ๊ฒฝ์ ํ์ธ)</div><div id="prompter_output_div" style="font-size:{font_size}px;">{raw_html}</div>'# โ ์์ ๋จ: ์/๋ค ์ด๋์ ์๋ @@๊ฐ ํฌํจ๋ ๋จ์ด ์๋ฒฝ ์ถ์ถmarkers = re.findall(r'[^\s]*@@[^\s]*', input_text)unique_markers =[]for m in markers:clean_m = m.strip('.,!?\n') # ๋์ ๋ถ์ ์ผํ๋ ๋ง์นจํ๋ ์ ๊ฑฐํด์ ๊น๋ํ๊ฒ ํ์if clean_m and clean_m not in unique_markers:unique_markers.append(clean_m)if unique_markers:marker_result = " / ".join(unique_markers)else:238 unmodified lineswith gr.Accordion("๐ ์์ ํ ์คํธ ๊ฒฐ๊ณผ (๋ณต์ฌ์ฉ) - ํด๋ฆญํด์ ํผ์น๊ธฐ", open=False):output_text = gr.Textbox(lines=8, show_label=False, show_copy_button=True, elem_id="output_text_area")# โ ๋ง์ปค ๋ชจ์๋ณด๊ธฐ ์ฐฝmarker_collection = gr.Textbox(label="๐จ ์์ ํ์ ๋จ์ด ๋ชจ์๋ณด๊ธฐ (@@)", interactive=False, lines=2)gr.Markdown("---")
app.py+12-7