joey1101 commited on
Commit
38a0904
·
verified ·
1 Parent(s): a480b15

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -1,4 +1,13 @@
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
  from huggingface_hub import snapshot_download
12
 
13
  # Clip