Tonic commited on
Commit
81e67ff
Β·
1 Parent(s): c06f586

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -21,9 +21,10 @@ model.to(device)
21
  class ChatBot:
22
  def __init__(self):
23
  self.history = []
24
-
25
  def predict(self, user_input, system_prompt="You are an expert medical analyst:"):
26
- prompt = [{'role': 'user', 'content': user_input}, {'role': 'system', 'content': system_prompt}]
 
 
27
  inputs = tokenizer.apply_chat_template(
28
  prompt,
29
  add_generation_prompt=True,
 
21
  class ChatBot:
22
  def __init__(self):
23
  self.history = []
 
24
  def predict(self, user_input, system_prompt="You are an expert medical analyst:"):
25
+ formatted_prompt = f"{user_input}\n{system_prompt}:"
26
+ prompt = [{'role': 'user', 'content': formatted_prompt}]
27
+ prompt = [{'role': 'user', 'content': user_input "\n" system_prompt}]
28
  inputs = tokenizer.apply_chat_template(
29
  prompt,
30
  add_generation_prompt=True,