zirui3 commited on
Commit
4045709
1 Parent(s): 975d27f

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -12,12 +12,12 @@ chip_map= {
12
  'gpt_neox.final_layer_norm': 0,
13
  'embed_out': 0
14
  }
15
- model = AutoModelForCausalLM.from_pretrained(name, device_map=chip_map, torch_dtype=torch.float16, load_in_8bit=True)
16
  #model = AutoModelForCausalLM.from_pretrained(model_name)
17
 
18
 
19
  def predict(input, history=[], MAX_NEW_TOKENS = 500):
20
- text = "User: " + input + "\n\nChip: "
21
  new_user_input_ids = tokenizer(text, return_tensors="pt").input_ids
22
  # bot_input_ids = torch.cat([torch.LongTensor(history), new_user_input_ids], dim=-1).to("cuda")
23
  bot_input_ids = torch.cat([torch.LongTensor(history), new_user_input_ids], dim=-1)
 
12
  'gpt_neox.final_layer_norm': 0,
13
  'embed_out': 0
14
  }
15
+ model = AutoModelForCausalLM.from_pretrained(model_name, device_map=chip_map, torch_dtype=torch.float16, load_in_8bit=True)
16
  #model = AutoModelForCausalLM.from_pretrained(model_name)
17
 
18
 
19
  def predict(input, history=[], MAX_NEW_TOKENS = 500):
20
+ text = "User: " + input + "\n\nAI: "
21
  new_user_input_ids = tokenizer(text, return_tensors="pt").input_ids
22
  # bot_input_ids = torch.cat([torch.LongTensor(history), new_user_input_ids], dim=-1).to("cuda")
23
  bot_input_ids = torch.cat([torch.LongTensor(history), new_user_input_ids], dim=-1)