Spaces:
Running
on
Zero
Running
on
Zero
Locutusque
commited on
Commit
•
a273772
1
Parent(s):
5a288e0
Update app.py
Browse files
app.py
CHANGED
@@ -26,13 +26,10 @@ def generate(
|
|
26 |
tokenizer.eos_token = "<|im_end|>"
|
27 |
print(tokenizer)
|
28 |
pipe.tokenizer = tokenizer
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
for (user_turn, assistant_turn) in history:
|
34 |
-
prompt += f"<|im_start|>user\n{user_turn}<|im_end|>\n<|im_start|>assistant\n{assistant_turn}<|im_end|>\n"
|
35 |
-
prompt += f"<|im_start|>user\n{message}<|im_end|>\n<|im_start|>assistant\n"
|
36 |
|
37 |
streamer = TextIteratorStreamer(pipe.tokenizer, timeout=240.0, skip_prompt=True, skip_special_tokens=True)
|
38 |
generation_kwargs = dict(
|
|
|
26 |
tokenizer.eos_token = "<|im_end|>"
|
27 |
print(tokenizer)
|
28 |
pipe.tokenizer = tokenizer
|
29 |
+
prompt = f"<|im_start|>system\n{system}<|im_end|>\n"
|
30 |
+
for (user_turn, assistant_turn) in history:
|
31 |
+
prompt += f"<|im_start|>user\n{user_turn}<|im_end|>\n<|im_start|>assistant\n{assistant_turn}<|im_end|>\n"
|
32 |
+
prompt += f"<|im_start|>user\n{message}<|im_end|>\n<|im_start|>assistant\n"
|
|
|
|
|
|
|
33 |
|
34 |
streamer = TextIteratorStreamer(pipe.tokenizer, timeout=240.0, skip_prompt=True, skip_special_tokens=True)
|
35 |
generation_kwargs = dict(
|