Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -34,6 +34,11 @@ for i, url in enumerate(urls):
|
|
34 |
#with open(f"./data/doc_{i}.txt", "w", encoding="utf-8") as f:
|
35 |
# f.write(text)
|
36 |
|
|
|
|
|
|
|
|
|
|
|
37 |
# 初始化 OpenVINO 模型
|
38 |
model_id = "hsuwill000/MiniCPM3-4B_int4_ov"
|
39 |
#model_id = "OpenVINO/Qwen3-0.6B-int4-ov"
|
@@ -118,9 +123,12 @@ with gr.Blocks() as demo:
|
|
118 |
status_box = gr.Textbox(label="狀態", interactive=False)
|
119 |
TPS_box = gr.Textbox(label="TPS", interactive=False)
|
120 |
with gr.Row():
|
121 |
-
|
122 |
-
|
123 |
-
|
|
|
|
|
|
|
124 |
textbox_output = gr.Markdown(label="robot answer:", elem_id="scroll_output")
|
125 |
|
126 |
start_btn.click(fn=start_chat, outputs=status_box)
|
|
|
34 |
#with open(f"./data/doc_{i}.txt", "w", encoding="utf-8") as f:
|
35 |
# f.write(text)
|
36 |
|
37 |
+
|
38 |
+
response = requests.get(urls[0])
|
39 |
+
response.encoding = 'utf-8' # 強制設為 UTF-8 編碼
|
40 |
+
story_default_text = response.text.strip()
|
41 |
+
|
42 |
# 初始化 OpenVINO 模型
|
43 |
model_id = "hsuwill000/MiniCPM3-4B_int4_ov"
|
44 |
#model_id = "OpenVINO/Qwen3-0.6B-int4-ov"
|
|
|
123 |
status_box = gr.Textbox(label="狀態", interactive=False)
|
124 |
TPS_box = gr.Textbox(label="TPS", interactive=False)
|
125 |
with gr.Row():
|
126 |
+
with gr.Column():
|
127 |
+
textbox_input = gr.Textbox(label="Prompt", lines=1, placeholder="Enter prompt here...")
|
128 |
+
button = gr.Button("Submit")
|
129 |
+
with gr.Column():
|
130 |
+
StoryBox = gr.Textbox(label="Story", lines=50, placeholder="Story here...", value=story_default_text)
|
131 |
+
|
132 |
textbox_output = gr.Markdown(label="robot answer:", elem_id="scroll_output")
|
133 |
|
134 |
start_btn.click(fn=start_chat, outputs=status_box)
|