Spaces:
Running
Running
Update app.py
Browse files127 unmodified lines12812913013113113213395 unmodified lines22923023123323223323472 unmodified lines3073083093123103113121 unmodified line31431531632031731831910 unmodified lines330331332333334335336337338339340341340341342127 unmodified lines elif tag in['replace', 'insert']: html_parts.append(f'<span style="background-color: #ffe066; font-weight: bold; padding: 2px; border-radius: 3px; color: #000;">{chunk}</span>') # โ
ํ๋กฌํํฐ ์ฐฝ์ ๋์ด๋ฅผ 'height: 500px;' ๋ก ์๋ฒฝํ๊ฒ ๊ณ ์ ํฉ๋๋ค. โ
html_output = f''' <div id="prompter_output_div" style="line-height:1.8; font-size:{font_size}px; padding:20px; border:1px solid #ddd; border-radius:8px; background-color:#333; color:#fff; height: 500px; max-height: 500px; overflow-y: auto;"> {"".join(html_parts)}95 unmodified lines}"""
# โ
์๋ณธ(1) / ๋ณํ์ฐฝ(2) / ํ๋กฌํํฐ(3) 3๋จ ์คํฌ๋กค ๋๊ธฐํ & ํ
์คํธ ๋๊ธฐํ ์๋ฐ์คํฌ๋ฆฝํธ โ
script_js = """function() { function applyFontSize(size) {72 unmodified lines}"""
# โ
css ํ๋ผ๋ฏธํฐ์ custom_css ์ ์ฉ โ
with gr.Blocks(theme="default", css=custom_css) as iface: gr.Markdown("## ๐๏ธ ๋๋ง์ TTS ์ ์ฒ๋ฆฌ ๋ณํ๊ธฐ (ํ๋กฌํํฐ ๋ชจ๋)") 1 unmodified line with gr.Tab("๐๏ธ ๋ฉ์ธ ํ๋ฉด"): with gr.Row(): with gr.Column(): # lines ์ค์ ๊ณผ ๋ฌด๊ดํ๊ฒ css๋ก ๋์ด๊ฐ 500px๋ก ๊ฐ์ ๊ณ ์ ๋ฉ๋๋ค. input_text = gr.Textbox(label="1๏ธโฃ ์๋ณธ ํ
์คํธ ์
๋ ฅ", elem_id="input_text_area") with gr.Group():10 unmodified lines btn_clr = gr.Button("๐๏ธ ๋๋ณธ ์ด๊ธฐํ", variant="stop") with gr.Column(): # โ
๋ณ๊ฒฝ๋ ๋ถ๋ถ: ๊น๋ง์ ํ๋กฌํํฐ ๋ทฐ๋ฅผ ๋งจ ์๋ก ์ฌ๋ ธ์ต๋๋ค! โ
output_html = gr.HTML(label="๐บ ํ๋กฌํํฐ ๋ทฐ (๋ณ๊ฒฝ์ ํ์ธ)") # โ
์์ ํ
์คํธ ๊ฒฐ๊ณผ์ฐฝ์ ํ๋กฌํํฐ ๋ทฐ ์๋๋ก ๋ด๋ ธ์ต๋๋ค! โ
with gr.Accordion("๐ ์์ ํ
์คํธ ๊ฒฐ๊ณผ (๋ณต์ฌ์ฉ) - ํด๋ฆญํด์ ํผ์น๊ธฐ", open=False): output_text = gr.Textbox(lines=8, label="2๏ธโฃ ๋ณํ๋ ํ
์คํธ", show_copy_button=True, elem_id="output_text_area") output_html = gr.HTML(label="๐บ ํ๋กฌํํฐ ๋ทฐ (๋ณ๊ฒฝ์ ํ์ธ)") btn_conv.click(fn=process_text, inputs=[input_text, use_g2p, auto_break, font_size], outputs=[output_text, output_html, char_count], api_name=False) btn_clr.click(fn=clear_all, outputs=[input_text, output_text, output_html, char_count], api_name=False) btn_copy.click(app.py+4-6