Locutusque commited on
Commit
a273772
1 Parent(s): 5a288e0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -26,13 +26,10 @@ def generate(
26
  tokenizer.eos_token = "<|im_end|>"
27
  print(tokenizer)
28
  pipe.tokenizer = tokenizer
29
- if model_name == "Locutusque/TinyMistral-248M-v3":
30
- prompt = " ".join(history) + message
31
- else:
32
- prompt = f"<|im_start|>system\n{system}<|im_end|>\n"
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(