Update app.py
Browse files
app.py
CHANGED
|
@@ -20,12 +20,15 @@ llm = Llama(
|
|
| 20 |
|
| 21 |
# Build inference prompt according to your dataset format
|
| 22 |
def format_prompt(user_message):
|
| 23 |
-
return
|
| 24 |
-
|
| 25 |
-
<|
|
| 26 |
-
|
| 27 |
-
<|
|
| 28 |
-
""
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
def respond(user_input):
|
| 31 |
prompt = format_prompt(user_input)
|
|
|
|
| 20 |
|
| 21 |
# Build inference prompt according to your dataset format
|
| 22 |
def format_prompt(user_message):
|
| 23 |
+
return (
|
| 24 |
+
"<|begin_of_text|>"
|
| 25 |
+
"<|start_header_id|>system<|end_header_id|>\n"
|
| 26 |
+
"You are a helpful assistant.\n"
|
| 27 |
+
"<|start_header_id|>user<|end_header_id|>\n"
|
| 28 |
+
f"{user_message}\n"
|
| 29 |
+
"<|start_header_id|>assistant<|end_header_id|>\n"
|
| 30 |
+
)
|
| 31 |
+
|
| 32 |
|
| 33 |
def respond(user_input):
|
| 34 |
prompt = format_prompt(user_input)
|