lucas-w commited on
Commit
5e00dcd
β€’
1 Parent(s): bf1ca2a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -27,15 +27,15 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
27
  peft_model_id = "charansr/llama2-7b-chat-hf-therapist"
28
  config = PeftConfig.from_pretrained(peft_model_id,
29
  use_auth_token="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")
30
- newmodel = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, return_dict=True, load_in_8bit=True, device_map='auto',
31
- use_auth_token="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")
32
 
33
  newtokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path,
34
  use_auth_token="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")
35
 
36
  # Load the Lora model
37
  newmodel = PeftModel.from_pretrained(newmodel, peft_model_id,
38
- use_auth_token="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")
39
 
40
  def givetext(input_text,lmodel,ltokenizer):
41
  eval_prompt_pt1 = """\nBelow is an instruction that describes a task. Write a response that appropriately completes the request.\n### Instruction: Act like a therapist and respond\n\n### Input: """
 
27
  peft_model_id = "charansr/llama2-7b-chat-hf-therapist"
28
  config = PeftConfig.from_pretrained(peft_model_id,
29
  use_auth_token="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")
30
+ #newmodel = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, return_dict=True, load_in_8bit=True, device_map='auto',
31
+ # use_auth_token="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")
32
 
33
  newtokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path,
34
  use_auth_token="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")
35
 
36
  # Load the Lora model
37
  newmodel = PeftModel.from_pretrained(newmodel, peft_model_id,
38
+ use_auth_token="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", load_in_8bit=True, device_map='auto')
39
 
40
  def givetext(input_text,lmodel,ltokenizer):
41
  eval_prompt_pt1 = """\nBelow is an instruction that describes a task. Write a response that appropriately completes the request.\n### Instruction: Act like a therapist and respond\n\n### Input: """