frankaging commited on
Commit
fb63a39
·
1 Parent(s): bfb4db6

initial commit

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -86,7 +86,7 @@ def generate(
86
  prompt = tokenizer.apply_chat_template(
87
  [{"role": "system", "content": system_prompt}, {"role": "user", "content": message}],
88
  tokenize=False)
89
- prompt = tokenizer(prompt, return_tensors="pt").to(device)
90
 
91
  unit_locations = torch.IntTensor([pyreft.get_intervention_locations(
92
  last_position=prompt["input_ids"].shape[-1],
 
86
  prompt = tokenizer.apply_chat_template(
87
  [{"role": "system", "content": system_prompt}, {"role": "user", "content": message}],
88
  tokenize=False)
89
+ prompt = tokenizer(prompt, return_tensors="pt").to(model.device)
90
 
91
  unit_locations = torch.IntTensor([pyreft.get_intervention_locations(
92
  last_position=prompt["input_ids"].shape[-1],