mamkkl commited on
Commit
3548597
·
verified ·
1 Parent(s): 407802b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -9,8 +9,6 @@ from peft import PeftModel
9
  For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
10
  """
11
  #client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
12
- from llama_rope_scaled_monkey_patch import replace_llama_rope_with_scaled_rope
13
- replace_llama_rope_with_scaled_rope()
14
  base_model = "Neko-Institute-of-Science/LLaMA-65B-HF"
15
  lora_weights = "./"
16
  #lora_weights = LoraConfig(
@@ -32,6 +30,8 @@ lora_weights = "./"
32
  #)
33
 
34
  cache_dir = "/data"
 
 
35
  model = transformers.AutoModelForCausalLM.from_pretrained(
36
  base_model,
37
  torch_dtype=torch.float16,
@@ -48,7 +48,6 @@ model = PeftModel.from_pretrained(
48
  )
49
  tokenizer = AutoTokenizer.from_pretrained(base_model,use_fast=False,cache_dir=cache_dir)
50
  tokenizer.pad_token = tokenizer.unk_token
51
- model.eval()
52
  PROMPT_DICT = {
53
  "prompt_input": (
54
  "Below is an instruction that describes a task, paired with further context. "
@@ -148,4 +147,5 @@ demo = gr.ChatInterface(
148
 
149
 
150
  if __name__ == "__main__":
 
151
  demo.launch()
 
9
  For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
10
  """
11
  #client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
 
 
12
  base_model = "Neko-Institute-of-Science/LLaMA-65B-HF"
13
  lora_weights = "./"
14
  #lora_weights = LoraConfig(
 
30
  #)
31
 
32
  cache_dir = "/data"
33
+ from llama_rope_scaled_monkey_patch import replace_llama_rope_with_scaled_rope
34
+ replace_llama_rope_with_scaled_rope()
35
  model = transformers.AutoModelForCausalLM.from_pretrained(
36
  base_model,
37
  torch_dtype=torch.float16,
 
48
  )
49
  tokenizer = AutoTokenizer.from_pretrained(base_model,use_fast=False,cache_dir=cache_dir)
50
  tokenizer.pad_token = tokenizer.unk_token
 
51
  PROMPT_DICT = {
52
  "prompt_input": (
53
  "Below is an instruction that describes a task, paired with further context. "
 
147
 
148
 
149
  if __name__ == "__main__":
150
+ model.eval()
151
  demo.launch()