Spaces:
Running
on
Zero
Running
on
Zero
Enable direct prompting
Browse files
app.py
CHANGED
|
@@ -203,13 +203,13 @@ def diffusion_chat(question, eot_weight, mask_weight, max_it, pause_length, shar
|
|
| 203 |
|
| 204 |
print('started generation')
|
| 205 |
prompt = f"User: {question}\nAssistant:"
|
| 206 |
-
prompt =
|
| 207 |
input_ids = tokenizer.encode(prompt, add_special_tokens=False)
|
| 208 |
answer_start = find_answer_start(input_ids, assistant_marker_ids)
|
| 209 |
# if answer_start is None:
|
| 210 |
# yield "Error: Could not find Assistant marker in input."
|
| 211 |
# return
|
| 212 |
-
answer_start =
|
| 213 |
|
| 214 |
if len(input_ids) < 256:
|
| 215 |
input_ids += [pad_token] * (256 - len(input_ids))
|
|
|
|
| 203 |
|
| 204 |
print('started generation')
|
| 205 |
prompt = f"User: {question}\nAssistant:"
|
| 206 |
+
prompt = question
|
| 207 |
input_ids = tokenizer.encode(prompt, add_special_tokens=False)
|
| 208 |
answer_start = find_answer_start(input_ids, assistant_marker_ids)
|
| 209 |
# if answer_start is None:
|
| 210 |
# yield "Error: Could not find Assistant marker in input."
|
| 211 |
# return
|
| 212 |
+
answer_start = len(input_ids)
|
| 213 |
|
| 214 |
if len(input_ids) < 256:
|
| 215 |
input_ids += [pad_token] * (256 - len(input_ids))
|