Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,7 @@ tokenizer.set_chat_template(tokenizer.chat_template)
|
|
20 |
|
21 |
def generate_response(prompt):
|
22 |
generated = pipe.generate([prompt], max_length=1024)
|
23 |
-
tokenpersec=f'{
|
24 |
match = re.search(r"<think>(.*?)</think>(.*)", generated, re.DOTALL)
|
25 |
|
26 |
if match:
|
@@ -35,7 +35,8 @@ demo = gr.Interface(
|
|
35 |
inputs=gr.Textbox(lines=5, label="輸入提示 (Prompt)"),
|
36 |
outputs=[
|
37 |
gr.Textbox(label="tokens/sec"),
|
38 |
-
gr.Textbox(label="
|
|
|
39 |
],
|
40 |
title="Qwen3-0.6B-int4-ov ",
|
41 |
description="基於 Qwen3-0.6B-int4-ov 推理應用,支援思考過程分離與 GUI。"
|
|
|
20 |
|
21 |
def generate_response(prompt):
|
22 |
generated = pipe.generate([prompt], max_length=1024)
|
23 |
+
tokenpersec=f'{generated.perf_metrics.get_throughput().mean:.2f}'
|
24 |
match = re.search(r"<think>(.*?)</think>(.*)", generated, re.DOTALL)
|
25 |
|
26 |
if match:
|
|
|
35 |
inputs=gr.Textbox(lines=5, label="輸入提示 (Prompt)"),
|
36 |
outputs=[
|
37 |
gr.Textbox(label="tokens/sec"),
|
38 |
+
gr.Textbox(label="思考過程"),
|
39 |
+
gr.Textbox(label="最終回應")
|
40 |
],
|
41 |
title="Qwen3-0.6B-int4-ov ",
|
42 |
description="基於 Qwen3-0.6B-int4-ov 推理應用,支援思考過程分離與 GUI。"
|