Linseypass commited on
Commit
316c6ac
·
1 Parent(s): a33b5ff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -11,13 +11,14 @@ import nltk
11
  nltk.download('punkt')
12
 
13
  # loads Guanaco 7B model - takes around 2-3 minutes - can do this separately
14
- model_name = "decapoda-research/llama-7b-hf-int4"
15
  adapters_name = 'timdettmers/guanaco-7b'
16
  # print(f"Starting to load the model {model_name} into memory")
17
  m = AutoModelForCausalLM.from_pretrained(
18
- model_name)
 
19
  m = PeftModel.from_pretrained(m, adapters_name)
20
- #m = m.merge_and_unload()
21
  tok = LlamaTokenizer.from_pretrained(model_name)
22
  tok.bos_token_id = 1
23
  stop_token_ids = [0]
 
11
  nltk.download('punkt')
12
 
13
  # loads Guanaco 7B model - takes around 2-3 minutes - can do this separately
14
+ model_name = "decapoda-research/llama-7b-hf"
15
  adapters_name = 'timdettmers/guanaco-7b'
16
  # print(f"Starting to load the model {model_name} into memory")
17
  m = AutoModelForCausalLM.from_pretrained(
18
+ model_name,
19
+ torch_dtype=torch.bfloat16)
20
  m = PeftModel.from_pretrained(m, adapters_name)
21
+ m = m.merge_and_unload()
22
  tok = LlamaTokenizer.from_pretrained(model_name)
23
  tok.bos_token_id = 1
24
  stop_token_ids = [0]