Spaces:
Running
Running
Update app.py
Browse files220 unmodified lines2212222232242252262272282292302312322332342352362372382392402412426 unmodified lines24925025123725225325424024125525625725824425926026126213 unmodified lines2762772782792802812822831 unmodified line28528628727127227328828927527627727829029129229363 unmodified lines35735835934836036136236313 unmodified lines377378379380381368382383384385220 unmodified lines except Exception as e: return f"โ JSON ํ์ฑ ์๋ฌ: {e}"
# โ
ํต์ฌ! ๋ค์ฌ์ฐ๊ธฐ ์์ธ(max-width)์ ๋ฌด๋ ฅํํ๊ณ ์์ชฝ์ 100% ๋์ผํ๊ฒ ์ธํ
ํ๋ ์๋ฒฝ CSS โ
custom_css = """/* Gradio์ HTML ์ปดํฌ๋ํธ๊ฐ ๊ฐ์ ๋ก ํญ์ ์ขํ๊ณ ์ค์ ์ ๋ ฌํ๋ ์
์ฑ ๊ธฐ๋ณธ๊ฐ์ ์๋ฒฝํ ๋ฌด๋ ฅํํฉ๋๋ค! */#prompter_html_wrap { width: 100% !important; max-width: 100% !important; margin: 0 !important; padding: 0 !important;}#prompter_html_wrap .prose { width: 100% !important; max-width: 100% !important; text-align: left !important; margin: 0 !important;}
/* ์ผ์ชฝ ์๋ณธ ํ
์คํธ ์ฐฝ */#input_text_area textarea { height: 500px !important;6 unmodified lines word-break: break-word !important;}
/* ์ค๋ฅธ์ชฝ ํ๋กฌํํฐ ๋ทฐ ๋ผ๋ฒจ (์ผ์ชฝ ๋ผ๋ฒจ๊ณผ ์ ํํ ์ผ์น) *//* ์ค๋ฅธ์ชฝ ํ๋กฌํํฐ ๋ทฐ ๋ผ๋ฒจ */#prompter_label_space { font-size: 13px !important; color: #6b7280 !important; margin-bottom: 6px !important; color: var(--body-text-color-subdued, #6b7280) !important; margin-bottom: 8px !important; display: block !important; text-align: left !important; font-weight: 500 !important; font-weight: 400 !important;}
/* ์ค๋ฅธ์ชฝ ํ๋กฌํํฐ ๋ทฐ ๊น๋ง ์ฐฝ */13 unmodified lines word-break: break-word !important; text-align: left !important; margin-top: 0 !important; width: 100% !important; max-width: 100% !important;}"""
1 unmodified linefunction() { function applyFontSize(size) { let ta1 = document.querySelector('#input_text_area textarea'); if(ta1) { ta1.style.fontSize = size + 'px'; } if(ta1) { ta1.style.fontSize = size + 'px'; } let ta2 = document.querySelector('#output_text_area textarea'); if(ta2) { ta2.style.fontSize = size + 'px'; ta2.style.lineHeight = '1.8'; } if(ta2) { ta2.style.fontSize = size + 'px'; ta2.style.lineHeight = '1.8'; } }
setTimeout(function() { applyFontSize(22); }, 500);63 unmodified lines gr.Markdown("## ๐๏ธ ๋๋ง์ TTS ์ ์ฒ๋ฆฌ ๋ณํ๊ธฐ (ํ๋กฌํํฐ ๋ชจ๋)") with gr.Tabs(): with gr.Tab("๐๏ธ ๋ฉ์ธ ํ๋ฉด"): # <- ๋ฐ๋ก ์ด ๋ถ๋ถ์์ ์คํ๊ฐ ์์์ต๋๋ค! gr.Tab ์ผ๋ก ์์ ์๋ฃ! with gr.Tab("๐๏ธ ๋ฉ์ธ ํ๋ฉด"): with gr.Row(): with gr.Column(): input_text = gr.Textbox(label="1๏ธโฃ ์๋ณธ ํ
์คํธ ์
๋ ฅ", elem_id="input_text_area")13 unmodified lines with gr.Column(): initial_html = '<div id="prompter_label_space">๐บ ํ๋กฌํํฐ ๋ทฐ (๋ณ๊ฒฝ์ ํ์ธ)</div><div id="prompter_output_div" style="font-size:22px;"></div>' # โ
๋ณ๊ฒฝ๋ ๋ถ๋ถ: elem_id="prompter_html_wrap" ๋ฅผ ๋ถ์ฌํด์ Gradio์ ๊ฐ์ ์ค์์ ๋ ฌ/ํญ์ ํ ์์ฑ์ CSS๋ก ๋ฌด๋ ฅํํฉ๋๋ค! โ
output_html = gr.HTML(value=initial_html) output_html = gr.HTML(value=initial_html, elem_id="prompter_html_wrap") with gr.Accordion("๐ ์์ ํ
์คํธ ๊ฒฐ๊ณผ (๋ณต์ฌ์ฉ) - ํด๋ฆญํด์ ํผ์น๊ธฐ", open=False): output_text = gr.Textbox(lines=8, show_label=False, show_copy_button=True, elem_id="output_text_area")app.py+27-13