joey1101 commited on
Commit
b2962e2
·
verified ·
1 Parent(s): 680ca5c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -1,4 +1,14 @@
1
  # -*- coding: utf-8 -*-
 
 
 
 
 
 
 
 
 
 
2
  from huggingface_hub import snapshot_download
3
 
4
  # Clip
 
1
  # -*- coding: utf-8 -*-
2
+ from ipex_llm.transformers import AutoModelForCausalLM
3
+ from transformers import LlamaTokenizer
4
+
5
+
6
+ llm = AutoModelForCausalLM.from_pretrained("checkpoints\\Llama-2-7b-chat-hf",load_in_low_bit="sym_int4")
7
+ llm.save_low_bit("checkpoints\\Llama-2-7b-chat-hf-INT4")
8
+
9
+ tokenizer = LlamaTokenizer.from_pretrained("checkpoints\\Llama-2-7b-chat-hf\\")
10
+ tokenizer.save_pretrained("checkpoints\\Llama-2-7b-chat-hf-INT4")
11
+
12
  from huggingface_hub import snapshot_download
13
 
14
  # Clip