cutechicken commited on
Commit
38f6996
โ€ข
1 Parent(s): afed118

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -526,8 +526,9 @@ body {
526
  }
527
  """
528
 
529
- # UI ๊ตฌ์„ฑ
530
- with gr.Blocks(css=CSS) as demo:
 
531
  with gr.Column():
532
  chatbot = gr.Chatbot(
533
  value=[],
@@ -588,6 +589,7 @@ with gr.Blocks(css=CSS) as demo:
588
  label="๋ฐ˜๋ณต ์–ต์ œ ๐Ÿ”„"
589
  )
590
 
 
591
  gr.Examples(
592
  examples=[
593
  ["๋‹ค์Œ ์ฝ”๋“œ์˜ ๋ฌธ์ œ์ ์„ ์ฐพ์•„๋‚ด๊ณ  ๊ฐœ์„ ๋œ ๋ฒ„์ „์„ ์ œ์‹œํ•ด์ฃผ์„ธ์š”:\ndef fibonacci(n):\n if n <= 1: return n\n return fibonacci(n-1) + fibonacci(n-2)"],
@@ -602,6 +604,9 @@ with gr.Blocks(css=CSS) as demo:
602
  )
603
 
604
  # ์ด๋ฒคํŠธ ๋ฐ”์ธ๋”ฉ
 
 
 
605
  msg.submit(
606
  stream_chat,
607
  inputs=[msg, chatbot, file_upload, temperature, max_new_tokens, top_p, top_k, penalty],
@@ -614,10 +619,6 @@ with gr.Blocks(css=CSS) as demo:
614
  outputs=[msg, chatbot]
615
  )
616
 
617
- def init_msg():
618
- return "ํŒŒ์ผ ๋ถ„์„์„ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค..."
619
-
620
- # file_upload.change() ์ด๋ฒคํŠธ๋ฅผ ์—ฌ๊ธฐ๋กœ ์ด๋™
621
  file_upload.change(
622
  init_msg,
623
  outputs=msg
 
526
  }
527
  """
528
 
529
+ demo = gr.Blocks(css=CSS)
530
+
531
+ with demo:
532
  with gr.Column():
533
  chatbot = gr.Chatbot(
534
  value=[],
 
589
  label="๋ฐ˜๋ณต ์–ต์ œ ๐Ÿ”„"
590
  )
591
 
592
+
593
  gr.Examples(
594
  examples=[
595
  ["๋‹ค์Œ ์ฝ”๋“œ์˜ ๋ฌธ์ œ์ ์„ ์ฐพ์•„๋‚ด๊ณ  ๊ฐœ์„ ๋œ ๋ฒ„์ „์„ ์ œ์‹œํ•ด์ฃผ์„ธ์š”:\ndef fibonacci(n):\n if n <= 1: return n\n return fibonacci(n-1) + fibonacci(n-2)"],
 
604
  )
605
 
606
  # ์ด๋ฒคํŠธ ๋ฐ”์ธ๋”ฉ
607
+ def init_msg():
608
+ return "ํŒŒ์ผ ๋ถ„์„์„ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค..."
609
+
610
  msg.submit(
611
  stream_chat,
612
  inputs=[msg, chatbot, file_upload, temperature, max_new_tokens, top_p, top_k, penalty],
 
619
  outputs=[msg, chatbot]
620
  )
621
 
 
 
 
 
622
  file_upload.change(
623
  init_msg,
624
  outputs=msg