jyhong836 commited on
Commit
ad0f0cc
·
1 Parent(s): 3a59b96

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -2
README.md CHANGED
@@ -20,16 +20,20 @@ License: [MIT License](https://opensource.org/license/mit/)
20
 
21
  How to use
22
  ```python
 
23
  base_model = 'llama-2-7b'
24
- comp_method = 'sparsegpt_unstructured'
25
  comp_degree = 0.1
26
- model_path = f'vita-group/comp-{base_model}_{comp_method}_s{comp_degree}'
 
27
  model = AutoModelForCausalLM.from_pretrained(
28
  model_path,
29
  torch_dtype=torch.float16,
30
  low_cpu_mem_usage=True,
31
  device_map="auto"
32
  )
 
 
 
33
  ```
34
 
35
 
 
20
 
21
  How to use
22
  ```python
23
+ from transformers import AutoModelForCausalLM, AutoTokenizer
24
  base_model = 'llama-2-7b'
 
25
  comp_degree = 0.1
26
+ comp_method = 'sparsegpt_unstructured'
27
+ model_path = f'vita-group/comp-{arch}_{comp_method}_s{comp_degree}'
28
  model = AutoModelForCausalLM.from_pretrained(
29
  model_path,
30
  torch_dtype=torch.float16,
31
  low_cpu_mem_usage=True,
32
  device_map="auto"
33
  )
34
+ tokenizer = AutoTokenizer.from_pretrained('meta-llama/Llama-2-7b')
35
+ input_ids = tokenizer('Hello! I am a VITA-compressed-LLM chatbot!', return_tensors='pt').input_ids
36
+ outputs = model.generate(input_ids)
37
  ```
38
 
39