hsuwill000 commited on
Commit
b37db0d
·
verified ·
1 Parent(s): fbc2d26

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -8,6 +8,7 @@ import re
8
  import gc
9
 
10
  # 下載模型
 
11
  model_ids = [
12
  "OpenVINO/Qwen3-0.6B-int4-ov",
13
  "OpenVINO/Qwen3-1.7B-int4-ov",
@@ -26,14 +27,17 @@ for model_id in model_ids:
26
  except Exception as e:
27
  print(f"Error downloading {model_id}: {e}") # Handle download errors gracefully
28
 
 
 
 
29
  # 建立推理管線 (Initialize with a default model first)
30
  device = "CPU"
31
- InUsed_model_name = "Qwen3-0.6B-int4-ov" # Choose a default model
32
  pipe = ov_genai.LLMPipeline(InUsed_model_name, device)
33
  tokenizer = pipe.get_tokenizer()
34
  tokenizer.set_chat_template(tokenizer.chat_template)
35
  config = ov_genai.GenerationConfig()
36
- config.max_new_tokens = 1024
37
 
38
  def streamer(subword):
39
  print(subword, end='', flush=True)
 
8
  import gc
9
 
10
  # 下載模型
11
+ '''
12
  model_ids = [
13
  "OpenVINO/Qwen3-0.6B-int4-ov",
14
  "OpenVINO/Qwen3-1.7B-int4-ov",
 
27
  except Exception as e:
28
  print(f"Error downloading {model_id}: {e}") # Handle download errors gracefully
29
 
30
+ '''
31
+ hf_hub.snapshot_download("hsuwill000/Llama-3.1-TAIDE-LX-8B-Chat_int4_ov", local_dir="ov", local_dir_use_symlinks=False)
32
+
33
  # 建立推理管線 (Initialize with a default model first)
34
  device = "CPU"
35
+ InUsed_model_name = "ov" # Choose a default model
36
  pipe = ov_genai.LLMPipeline(InUsed_model_name, device)
37
  tokenizer = pipe.get_tokenizer()
38
  tokenizer.set_chat_template(tokenizer.chat_template)
39
  config = ov_genai.GenerationConfig()
40
+ config.max_new_tokens = 4096
41
 
42
  def streamer(subword):
43
  print(subword, end='', flush=True)