Spaces:
Running
Running
Update app.py
Browse files127 unmodified lines12812913013113113213387 unmodified lines22122222322522422522622 unmodified lines2492502512542522532542553 unmodified lines25926026126426226326426579 unmodified lines34534634735034834935035112 unmodified lines364365366369367368369127 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>') # โ
ํต์ฌ 1: ๋ผ๋ฒจ(์ ๋ชฉ)๊ณผ ๊น๋ง์ฐฝ์ ํ๋์ HTML๋ก ๋ฌถ์ด์ ๊ฐ๊ฒฉ(Gap)์ ์๋ฒฝํ ์์ด์ต๋๋ค. โ
html_output = f''' <div id="prompter_label_space">๐บ ํ๋กฌํํฐ ๋ทฐ (๋ณ๊ฒฝ์ ํ์ธ)</div> <div id="prompter_output_div" style="font-size:{font_size}px;">87 unmodified lines except Exception as e: return f"โ JSON ํ์ฑ ์๋ฌ: {e}"
# โ
์์ชฝ ์ฐฝ์ ๋ด๋ถ ์ฌ๋ฐฑ(padding), ์ ๋ ฌ(text-align), ์ค๊ฐ๊ฒฉ(line-height)์ ์๋ฅ์ด์ฒ๋ผ ๋๊ฐ์ด ๋ง์ถ๋ CSS โ
custom_css = """/* ์ผ์ชฝ ์๋ณธ ํ
์คํธ ์ฐฝ */#input_text_area textarea {22 unmodified lines height: 500px !important; max-height: 500px !important; overflow-y: auto !important; padding: 16px !important; /* ์ผ์ชฝ ์ฐฝ๊ณผ ๋๊ฐ์ ์ฌ๋ฐฑ */ padding: 16px !important; line-height: 1.8 !important; box-sizing: border-box !important; background-color: #333 !important;3 unmodified lines font-family: inherit !important; white-space: pre-wrap !important; word-break: break-word !important; text-align: left !important; /* โ
ํต์ฌ 2: ๊ธ์๊ฐ ๊ฐ์ด๋ฐ ์ ๋ ฌ๋์ง ์๊ณ ๋ฌด์กฐ๊ฑด ์ผ์ชฝ๋ถํฐ ์์๋๋๋ก ๊ฐ์ ๊ณ ์ โ
*/ text-align: left !important; margin-top: 0 !important;}"""79 unmodified lines gr.Markdown("## ๐๏ธ ๋๋ง์ TTS ์ ์ฒ๋ฆฌ ๋ณํ๊ธฐ (ํ๋กฌํํฐ ๋ชจ๋)") with gr.Tabs(): with Tab("๐๏ธ ๋ฉ์ธ ํ๋ฉด"): with gr.Tab("๐๏ธ ๋ฉ์ธ ํ๋ฉด"): # <- ๋ฐ๋ก ์ด ๋ถ๋ถ์์ ์คํ๊ฐ ์์์ต๋๋ค! gr.Tab ์ผ๋ก ์์ ์๋ฃ! with gr.Row(): with gr.Column(): input_text = gr.Textbox(label="1๏ธโฃ ์๋ณธ ํ
์คํธ ์
๋ ฅ", elem_id="input_text_area")12 unmodified lines btn_clr = gr.Button("๐๏ธ ๋๋ณธ ์ด๊ธฐํ", variant="stop") with gr.Column(): # ์ด๊ธฐ ๋น ํ๋ฉด์ ์ํด ๋ผ๋ฒจ๊ณผ ๊น๋ง ์ฐฝ ๋ผ๋๋ฅผ ์์ฑํฉ๋๋ค. initial_html = '<div id="prompter_label_space">๐บ ํ๋กฌํํฐ ๋ทฐ (๋ณ๊ฒฝ์ ํ์ธ)</div><div id="prompter_output_div" style="font-size:22px;"></div>' output_html = gr.HTML(value=initial_html) app.py+3-6