lucas-w commited on
Commit
1526c6b
β€’
1 Parent(s): 1eb51f1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -29,17 +29,17 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
29
  peft_model_id = "charansr/llama2-7b-chat-hf-therapist"
30
 
31
  config = PeftConfig.from_pretrained(peft_model_id,
32
- use_auth_token="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", load_in_8bit=True)
33
 
34
- newmodel = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, return_dict=True, load_in_8bit=True,
35
  use_auth_token="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").to("cpu")
36
 
37
  newtokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path,
38
- use_auth_token="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", load_in_8bit=True).to("cpu")
39
 
40
  # Load the Lora model
41
  newmodel = PeftModel.from_pretrained(newmodel, peft_model_id,
42
- use_auth_token="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", load_in_8bit=True).to("cpu")
43
 
44
  def givetext(input_text,lmodel,ltokenizer):
45
  try:
 
29
  peft_model_id = "charansr/llama2-7b-chat-hf-therapist"
30
 
31
  config = PeftConfig.from_pretrained(peft_model_id,
32
+ use_auth_token="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", load_in_4bit=True)
33
 
34
+ newmodel = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, return_dict=True, load_in_4bit=True,
35
  use_auth_token="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").to("cpu")
36
 
37
  newtokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path,
38
+ use_auth_token="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", load_in_4bit=True).to("cpu")
39
 
40
  # Load the Lora model
41
  newmodel = PeftModel.from_pretrained(newmodel, peft_model_id,
42
+ use_auth_token="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", load_in_4bit=True).to("cpu")
43
 
44
  def givetext(input_text,lmodel,ltokenizer):
45
  try: