Spaces:
Running
on
Zero
Running
on
Zero
frankaging
commited on
Commit
·
327242b
1
Parent(s):
a4bd2e7
initial commit
Browse files
app.py
CHANGED
@@ -85,7 +85,7 @@ def generate(
|
|
85 |
prompt = tokenizer.apply_chat_template(
|
86 |
[{"role": "system", "content": system_prompt}, {"role": "user", "content": message}],
|
87 |
tokenize=False)
|
88 |
-
prompt = tokenizer(prompt, return_tensors="pt").to(device)
|
89 |
|
90 |
unit_locations = torch.IntTensor([pyreft.get_intervention_locations(
|
91 |
last_position=prompt["input_ids"].shape[-1],
|
|
|
85 |
prompt = tokenizer.apply_chat_template(
|
86 |
[{"role": "system", "content": system_prompt}, {"role": "user", "content": message}],
|
87 |
tokenize=False)
|
88 |
+
prompt = tokenizer(prompt, return_tensors="pt").to(model.device)
|
89 |
|
90 |
unit_locations = torch.IntTensor([pyreft.get_intervention_locations(
|
91 |
last_position=prompt["input_ids"].shape[-1],
|