雷娃 commited on
Commit
77b7aca
·
1 Parent(s): c89c1f6

modify the layout of input and output

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -45,7 +45,14 @@ def chat(user_input, max_new_tokens=2048):
45
  thread.join()
46
 
47
  # Create a custom layout using Blocks
48
- with gr.Blocks() as demo:
 
 
 
 
 
 
 
49
  gr.Markdown(
50
  "## Ling-lite-1.5 AI Assistant\n"
51
  "Based on [inclusionAI/Ling-lite-1.5](https://huggingface.co/inclusionAI/Ling-lite-1.5) "
@@ -55,7 +62,7 @@ with gr.Blocks() as demo:
55
  max_tokens_slider = gr.Slider(minimum=100, maximum=2048, step=50, label="Generated length")
56
 
57
  # output_box = gr.Textbox(lines=10, label="Response")
58
- output_box = gr.Markdown(lines=8, label="Response")
59
  input_box = gr.Textbox(lines=8, label="Input you question")
60
 
61
  examples = gr.Examples(
 
45
  thread.join()
46
 
47
  # Create a custom layout using Blocks
48
+ with gr.Blocks(css="""
49
+ #markdown-output {
50
+ height: 300px;
51
+ overflow-y: auto;
52
+ border: 1px solid #ddd;
53
+ padding: 10px;
54
+ }
55
+ """) as demo:
56
  gr.Markdown(
57
  "## Ling-lite-1.5 AI Assistant\n"
58
  "Based on [inclusionAI/Ling-lite-1.5](https://huggingface.co/inclusionAI/Ling-lite-1.5) "
 
62
  max_tokens_slider = gr.Slider(minimum=100, maximum=2048, step=50, label="Generated length")
63
 
64
  # output_box = gr.Textbox(lines=10, label="Response")
65
+ output_box = gr.Markdown(label="Response", elem_id="markdown-output")
66
  input_box = gr.Textbox(lines=8, label="Input you question")
67
 
68
  examples = gr.Examples(