hsuwill000 commited on
Commit
cbbc528
·
verified ·
1 Parent(s): 1394e9d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -38,11 +38,18 @@ def generate_stream(prompt):
38
  yield result # 把逐步結果傳給 output textbox
39
 
40
 
41
- with gr.Blocks() as demo:
 
 
 
 
 
 
 
42
  gr.Markdown("## 🧠 OpenVINO Streaming Demo with Gradio Textbox")
43
 
44
  textbox_input = gr.Textbox(label="Prompt", lines=1, placeholder="Enter prompt here...")
45
- textbox_output = gr.Textbox(label="Output", lines=5)
46
 
47
  # 按鈕控制觸發推論
48
  button = gr.Button("Submit")
 
38
  yield result # 把逐步結果傳給 output textbox
39
 
40
 
41
+ with gr.Blocks(css="""
42
+ #scrollbox textarea {
43
+ overflow-y: auto !important;
44
+ height: 300px !important;
45
+ resize: none;
46
+ white-space: pre-wrap;
47
+ }
48
+ """) as demo:
49
  gr.Markdown("## 🧠 OpenVINO Streaming Demo with Gradio Textbox")
50
 
51
  textbox_input = gr.Textbox(label="Prompt", lines=1, placeholder="Enter prompt here...")
52
+ textbox_output = gr.Textbox(label="Output", elem_id="scrollbox", lines=10)
53
 
54
  # 按鈕控制觸發推論
55
  button = gr.Button("Submit")