Aratako commited on
Commit
28c9c77
·
verified ·
1 Parent(s): 625dd80

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -23,7 +23,7 @@ LICENSE = """
23
 
24
  PLACEHOLDER = """
25
  <div style="padding: 30px; text-align: center; display: flex; flex-direction: column; align-items: center;">
26
- <h1 style="font-size: 28px; margin-bottom: 2px; opacity: 0.55;">DeepSeek-R1-Distill-Llama-8B</h1>
27
  <p style="font-size: 18px; margin-bottom: 2px; opacity: 0.65;">Ask me anything...</p>
28
  </div>
29
  """
@@ -71,7 +71,9 @@ def chat_llama3_8b(message: str,
71
  conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
72
  conversation.append({"role": "user", "content": message})
73
 
74
- input_ids = tokenizer.apply_chat_template(conversation, return_tensors="pt").to(model.device)
 
 
75
 
76
  streamer = TextIteratorStreamer(tokenizer, timeout=10.0, skip_prompt=True, skip_special_tokens=True)
77
 
 
23
 
24
  PLACEHOLDER = """
25
  <div style="padding: 30px; text-align: center; display: flex; flex-direction: column; align-items: center;">
26
+ <h1 style="font-size: 28px; margin-bottom: 2px; opacity: 0.55;">DeepSeek-R1-Distill-Qwen-32B-bnb-4bit</h1>
27
  <p style="font-size: 18px; margin-bottom: 2px; opacity: 0.65;">Ask me anything...</p>
28
  </div>
29
  """
 
71
  conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
72
  conversation.append({"role": "user", "content": message})
73
 
74
+ input_ids = tokenizer.apply_chat_template(conversation, return_tensors="pt", add_generation_prompt=True).to(model.device)
75
+ # for debug
76
+ print(tokenizer.apply_chat_template(conversation, add_generation_prompt=True, tokenize=False))
77
 
78
  streamer = TextIteratorStreamer(tokenizer, timeout=10.0, skip_prompt=True, skip_special_tokens=True)
79