hsuwill000 commited on
Commit
38b3f94
Β·
verified Β·
1 Parent(s): 7c38b81

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -41,7 +41,7 @@ def generate_stream(prompt):
41
  def worker():
42
  # εœ¨θƒŒζ™― thread δΈ­εšζŽ¨θ«–
43
  nonlocal tps_result
44
- gen_result = pipe.generate([prompt], streamer=streamer, max_new_tokens=32767)
45
  tps = gen_result.perf_metrics.get_throughput().mean
46
  tps_result = f"{tps:.2f} tokens/s"
47
  q.put(None) # η΅ζŸη¬¦θ™Ÿ
@@ -70,7 +70,7 @@ with gr.Blocks(css="""
70
  with gr.Row():
71
  start_btn = gr.Button("開始對話")
72
  end_btn = gr.Button("硐束對話")
73
- status_box = gr.Textbox(label="η‹€ζ…‹",max_lines=1, max_length=1, interactive=False)
74
  TPS_box = gr.Textbox(label="TPS", interactive=False)
75
 
76
  start_btn.click(fn=start_chat, outputs=status_box)
 
41
  def worker():
42
  # εœ¨θƒŒζ™― thread δΈ­εšζŽ¨θ«–
43
  nonlocal tps_result
44
+ gen_result = pipe.generate([prompt], streamer=streamer, max_new_tokens=1024)
45
  tps = gen_result.perf_metrics.get_throughput().mean
46
  tps_result = f"{tps:.2f} tokens/s"
47
  q.put(None) # η΅ζŸη¬¦θ™Ÿ
 
70
  with gr.Row():
71
  start_btn = gr.Button("開始對話")
72
  end_btn = gr.Button("硐束對話")
73
+ status_box = gr.Textbox(label="η‹€ζ…‹", interactive=False)
74
  TPS_box = gr.Textbox(label="TPS", interactive=False)
75
 
76
  start_btn.click(fn=start_chat, outputs=status_box)