CMLL commited on
Commit
c96a1b8
1 Parent(s): 96a7695

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -8
app.py CHANGED
@@ -79,8 +79,6 @@ def generate(
79
 
80
  # ... (前面的代码保持不变)
81
 
82
- # ... (前面的代码保持不变)
83
-
84
  chat_interface = gr.ChatInterface(
85
  fn=generate,
86
  additional_inputs=[
@@ -88,7 +86,7 @@ chat_interface = gr.ChatInterface(
88
  gr.Slider(
89
  label="Max new tokens",
90
  minimum=1,
91
- maximum=MAX_MAX_NEW_TOKENS,
92
  step=1,
93
  value=DEFAULT_MAX_NEW_TOKENS,
94
  ),
@@ -130,14 +128,18 @@ chat_interface = gr.ChatInterface(
130
  ["写一篇关于'AI在中医研究中的应用'的100字文章。"],
131
  ["写一篇从中医角度关于'秋季女性健康调养方案'的1000字科普文章,从季节变化、饮食调理、活动养生等方面进行阐述"],
132
  ],
 
133
  )
134
 
135
  with gr.Blocks(css="style.css") as demo:
136
- gr.Markdown(DESCRIPTION)
137
- gr.DuplicateButton(value="Duplicate Space for private use", elem_id="duplicate-button")
138
- with gr.Column(elem_classes="chatbox-container"):
139
- chat_interface.render()
140
- gr.Markdown(LICENSE)
 
 
 
141
 
142
  if __name__ == "__main__":
143
  demo.queue(max_size=20).launch()
 
79
 
80
  # ... (前面的代码保持不变)
81
 
 
 
82
  chat_interface = gr.ChatInterface(
83
  fn=generate,
84
  additional_inputs=[
 
86
  gr.Slider(
87
  label="Max new tokens",
88
  minimum=1,
89
+ maximum=MAX_MAX_TOKENS,
90
  step=1,
91
  value=DEFAULT_MAX_NEW_TOKENS,
92
  ),
 
128
  ["写一篇关于'AI在中医研究中的应用'的100字文章。"],
129
  ["写一篇从中医角度关于'秋季女性健康调养方案'的1000字科普文章,从季节变化、饮食调理、活动养生等方面进行阐述"],
130
  ],
131
+ chatbot=gr.Chatbot(height=600), # 增加聊天框高度
132
  )
133
 
134
  with gr.Blocks(css="style.css") as demo:
135
+ with gr.Row():
136
+ with gr.Column(scale=2):
137
+ gr.Markdown(DESCRIPTION)
138
+ gr.DuplicateButton(value="Duplicate Space for private use", elem_id="duplicate-button")
139
+ chat_interface.render()
140
+ with gr.Column(scale=1):
141
+ gr.Markdown("## Additional Information")
142
+ gr.Markdown(LICENSE)
143
 
144
  if __name__ == "__main__":
145
  demo.queue(max_size=20).launch()