hsuwill000 commited on
Commit
354950f
·
verified ·
1 Parent(s): 208aae9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -6,9 +6,9 @@ import numpy as np
6
  import gradio as gr
7
  import re
8
  import gc
 
9
 
10
-
11
- hf_hub.snapshot_download(repo_id="OpenVINO/Qwen3-0.6B-int4-ov", local_dir="ov", local_dir_use_symlinks=False)
12
 
13
  # 初始化模型
14
  device = "CPU"
@@ -18,7 +18,10 @@ pipe = ov_genai.LLMPipeline(model_path, device)
18
 
19
  tokenizer = pipe.get_tokenizer()
20
  tokenizer.set_chat_template(tokenizer.chat_template)
21
-
 
 
 
22
 
23
  def streamer(subword):
24
  global output_buffer
 
6
  import gradio as gr
7
  import re
8
  import gc
9
+ from openvino_genai import GenerationConfig
10
 
11
+ hf_hub.snapshot_download(repo_id="hsuwill000/Llama-3.1-TAIDE-LX-8B-Chat_int4_ov", local_dir="ov", local_dir_use_symlinks=False)
 
12
 
13
  # 初始化模型
14
  device = "CPU"
 
18
 
19
  tokenizer = pipe.get_tokenizer()
20
  tokenizer.set_chat_template(tokenizer.chat_template)
21
+ # 定義你要偵測的結束詞(注意是最終解碼後出現的文字)
22
+ config = GenerationConfig(
23
+ stop_strings=set(["<|eot_id|>"]) # ✅ 這是 set
24
+ )
25
 
26
  def streamer(subword):
27
  global output_buffer