ginipick commited on
Commit
15dffdd
·
verified ·
1 Parent(s): 3c23805

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -19
app.py CHANGED
@@ -322,22 +322,16 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="teal", secondary_hue="slate", n
322
  )
323
 
324
 
325
- # Add CSS styling
326
- demo.load(lambda: None, _js="""
327
- () => {
328
- const style = document.createElement('style');
329
- style.textContent = `
330
  .chatbot-wrapper .message {
331
- white-space: pre-wrap; /* for preserving line breaks within the chatbot message */
332
- word-wrap: break-word; /* for breaking words when the text length exceed the available area */
333
- }
334
- `;
335
- document.head.appendChild(style);
336
- }
337
- """)
338
-
339
- # Add CSS styling
340
- with gr.Blocks() as demo: # Use blocks to add javascript styling
341
  gr.Markdown("# Chat with Gemini 2.0 Flash and See its Thoughts 💭")
342
 
343
  gr.HTML("""<a href="https://visitorbadge.io/status?path=https%3A%2F%2Faiqcamp-Gemini2-Flash-Thinking.hf.space">
@@ -456,7 +450,8 @@ with gr.Blocks() as demo: # Use blocks to add javascript styling
456
  """
457
  )
458
 
459
- # CSS 스타일링 추가
 
460
  demo.load(js="""
461
  () => {
462
  const style = document.createElement('style');
@@ -469,9 +464,6 @@ with gr.Blocks() as demo: # Use blocks to add javascript styling
469
  document.head.appendChild(style);
470
  }
471
  """)
472
-
473
-
474
-
475
 
476
 
477
  # Launch the interface
 
322
  )
323
 
324
 
325
+ # 메인 Blocks 인터페이스 생성
326
+ with gr.Blocks(
327
+ theme=gr.themes.Soft(primary_hue="teal", secondary_hue="slate", neutral_hue="neutral"),
328
+ css="""
 
329
  .chatbot-wrapper .message {
330
+ white-space: pre-wrap;
331
+ word-wrap: break-word;
332
+ }
333
+ """
334
+ ) as demo:
 
 
 
 
 
335
  gr.Markdown("# Chat with Gemini 2.0 Flash and See its Thoughts 💭")
336
 
337
  gr.HTML("""<a href="https://visitorbadge.io/status?path=https%3A%2F%2Faiqcamp-Gemini2-Flash-Thinking.hf.space">
 
450
  """
451
  )
452
 
453
+
454
+ # Add CSS styling
455
  demo.load(js="""
456
  () => {
457
  const style = document.createElement('style');
 
464
  document.head.appendChild(style);
465
  }
466
  """)
 
 
 
467
 
468
 
469
  # Launch the interface