hsuwill000 commited on
Commit
edd5af4
·
verified ·
1 Parent(s): 23052cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -32,8 +32,7 @@ model_path = "ov"
32
  '''
33
  hf_hub.snapshot_download(model_id, local_dir=model_path)
34
  '''
35
- model_path = "ov"
36
- pipe = ov_genai.LLMPipeline(model_path, "CPU")
37
 
38
  config = ov_genai.GenerationConfig()
39
  config.max_new_tokens = 4096
@@ -41,7 +40,7 @@ config.top_p = 0.9;
41
  config.top_k = 30;
42
 
43
 
44
- pipe = OVModelForCausalLM.from_pretrained(
45
  model_id,
46
  export=True,
47
  quantization_config=OVWeightQuantizationConfig(bits=4),
@@ -49,7 +48,10 @@ pipe = OVModelForCausalLM.from_pretrained(
49
 
50
 
51
  # save the model after optimization
52
- #pipe.save_pretrained(model_path)
 
 
 
53
 
54
  #pipe.start_chat()
55
 
 
32
  '''
33
  hf_hub.snapshot_download(model_id, local_dir=model_path)
34
  '''
35
+
 
36
 
37
  config = ov_genai.GenerationConfig()
38
  config.max_new_tokens = 4096
 
40
  config.top_k = 30;
41
 
42
 
43
+ model = OVModelForCausalLM.from_pretrained(
44
  model_id,
45
  export=True,
46
  quantization_config=OVWeightQuantizationConfig(bits=4),
 
48
 
49
 
50
  # save the model after optimization
51
+ model.save_pretrained(model_path)
52
+
53
+
54
+ pipe = ov_genai.LLMPipeline(model_path, "CPU")
55
 
56
  #pipe.start_chat()
57