wanda222 commited on
Commit
4bf4dcf
ยท
verified ยท
1 Parent(s): d76052b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -3
app.py CHANGED
@@ -98,14 +98,19 @@ def toggle_html_view(current_html, is_visible):
98
  with gr.Blocks() as demo:
99
  gr.Markdown("# ๐Ÿ“„ ์žฌ๋ฌด์ œํ‘œ ๋ถ„์„ ์ฑ—๋ด‡")
100
  gr.Markdown("1. Document Parse API๋กœ PDF ๋ฌธ์„œ๋ฅผ HTML๋กœ ๋ณ€ํ™˜ํ•ฉ๋‹ˆ๋‹ค.\n"
101
- "2. Solar LLM์„ ํ†ตํ•ด ๋ฌธ์„œ ๊ธฐ๋ฐ˜ ์งˆ๋ฌธ์— ๋‹ต๋ณ€ํ•ฉ๋‹ˆ๋‹ค.")
 
 
102
 
103
  with gr.Row():
104
  file_input = gr.File(label="๐Ÿ“Ž ์žฌ๋ฌด์ œํ‘œ ์—…๋กœ๋“œ")
105
  parse_btn = gr.Button("๋ฌธ์„œ HTML ๋ณ€ํ™˜")
106
 
107
- html_output = gr.Textbox(label="๐Ÿ“˜ ๋ฌธ์„œ ๋‚ด์šฉ", lines=10, visible=True)
108
- html_display = gr.HTML(visible=False)
 
 
 
109
  toggle_html_btn = gr.Button("๐Ÿ” HTML ๋ณด๊ธฐ ์ „ํ™˜")
110
  html_visible_state = gr.State(False)
111
 
@@ -136,5 +141,18 @@ with gr.Blocks() as demo:
136
  outputs=[chatbot, chat_state, user_question],
137
  show_progress=True
138
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
139
 
140
  demo.launch()
 
98
  with gr.Blocks() as demo:
99
  gr.Markdown("# ๐Ÿ“„ ์žฌ๋ฌด์ œํ‘œ ๋ถ„์„ ์ฑ—๋ด‡")
100
  gr.Markdown("1. Document Parse API๋กœ PDF ๋ฌธ์„œ๋ฅผ HTML๋กœ ๋ณ€ํ™˜ํ•ฉ๋‹ˆ๋‹ค.\n"
101
+ "2. Solar LLM์„ ํ†ตํ•ด ๋ฌธ์„œ ๊ธฐ๋ฐ˜ ์งˆ๋ฌธ์— ๋‹ต๋ณ€ํ•ฉ๋‹ˆ๋‹ค.\n"
102
+ "์˜ˆ์ œ ํŒŒ์ผ์€ Files ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜๋ฉด ํ™•์ธ ๋ฐ ๋‹ค์šด๋กœ๋“œ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."
103
+ )
104
 
105
  with gr.Row():
106
  file_input = gr.File(label="๐Ÿ“Ž ์žฌ๋ฌด์ œํ‘œ ์—…๋กœ๋“œ")
107
  parse_btn = gr.Button("๋ฌธ์„œ HTML ๋ณ€ํ™˜")
108
 
109
+ # html_output = gr.Textbox(label="๐Ÿ“˜ ๋ฌธ์„œ ๋‚ด์šฉ", lines=10, visible=True)
110
+ # html_display = gr.HTML(visible=False)
111
+ html_output = gr.Textbox(label="๐Ÿ“˜ ๋ฌธ์„œ ๋‚ด์šฉ", lines=10, visible=True, elem_id="scrollable-html")
112
+ html_display = gr.HTML(visible=False, elem_id="scrollable-html-display")
113
+
114
  toggle_html_btn = gr.Button("๐Ÿ” HTML ๋ณด๊ธฐ ์ „ํ™˜")
115
  html_visible_state = gr.State(False)
116
 
 
141
  outputs=[chatbot, chat_state, user_question],
142
  show_progress=True
143
  )
144
+ demo.css = """
145
+ #scrollable-html, #scrollable-html-display {
146
+ max-height: 400px;
147
+ overflow: auto;
148
+ border: 1px solid #AEB3FA; /* Primary 30 */
149
+ padding: 16px;
150
+ background-color: #F4F4FF; /* Primary 10 */
151
+ border-radius: 12px;
152
+ font-family: 'Arial', sans-serif;
153
+ color: #2F22A4; /* Primary 60 */
154
+ box-shadow: 0 2px 6px rgba(128, 92, 251, 0.1); /* Ups Purple */
155
+ }
156
+ """
157
 
158
  demo.launch()