JunchuanYu commited on
Commit
e71b31a
·
1 Parent(s): 439cca3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -17,7 +17,7 @@ gr.Chatbot.postprocess = postprocess
17
  with open("css_new.css", "r", encoding="utf-8") as f:
18
  css = f.read()
19
 
20
- with gr.Blocks(css=css,theme=gr.themes.Soft()) as demo:
21
  history = gr.State([])
22
  token_count = gr.State([])
23
  promptTemplates = gr.State(load_template('myprompts.json', mode=2))
@@ -32,7 +32,6 @@ with gr.Blocks(css=css,theme=gr.themes.Soft()) as demo:
32
  gr.Markdown(description)
33
  with gr.Column(scale=1):
34
  with gr.Box():
35
- # dropdown.render()
36
  toggle_dark = gr.Button(value="Toggle Dark").style(full_width=True)
37
 
38
  with gr.Row(scale=1).style(equal_height=True):
@@ -74,12 +73,13 @@ with gr.Blocks(css=css,theme=gr.themes.Soft()) as demo:
74
  <img src="https://dunazo.oss-cn-beijing.aliyuncs.com/blog/shoukuanma222.png" style="margin-left:25px;width:170px;height:190px;">
75
  </div>
76
  """)
77
- # dropdown.change(None, dropdown, None, _js=js)
78
  toggle_dark.click(None,_js="""
79
  () => {
80
  document.body.classList.toggle('dark');
81
  document.querySelector('gradio-app').style.backgroundColor = 'var(--color-background-primary)'
82
  }""",)
 
83
  keyTxt.submit(submit_key, keyTxt, [user_api_key, status_display])
84
  keyTxt.change(submit_key, keyTxt, [user_api_key, status_display])
85
  # Chatbot
 
17
  with open("css_new.css", "r", encoding="utf-8") as f:
18
  css = f.read()
19
 
20
+ with gr.Blocks(css=css,theme='gradio/soft') as demo:
21
  history = gr.State([])
22
  token_count = gr.State([])
23
  promptTemplates = gr.State(load_template('myprompts.json', mode=2))
 
32
  gr.Markdown(description)
33
  with gr.Column(scale=1):
34
  with gr.Box():
 
35
  toggle_dark = gr.Button(value="Toggle Dark").style(full_width=True)
36
 
37
  with gr.Row(scale=1).style(equal_height=True):
 
73
  <img src="https://dunazo.oss-cn-beijing.aliyuncs.com/blog/shoukuanma222.png" style="margin-left:25px;width:170px;height:190px;">
74
  </div>
75
  """)
76
+
77
  toggle_dark.click(None,_js="""
78
  () => {
79
  document.body.classList.toggle('dark');
80
  document.querySelector('gradio-app').style.backgroundColor = 'var(--color-background-primary)'
81
  }""",)
82
+
83
  keyTxt.submit(submit_key, keyTxt, [user_api_key, status_display])
84
  keyTxt.change(submit_key, keyTxt, [user_api_key, status_display])
85
  # Chatbot