Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
|
|
|
|
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,
|