make system message empty by default
Browse files
app.py
CHANGED
@@ -23,7 +23,11 @@ def respond(
|
|
23 |
temperature,
|
24 |
top_p,
|
25 |
):
|
26 |
-
|
|
|
|
|
|
|
|
|
27 |
|
28 |
for val in history:
|
29 |
if val[0]:
|
@@ -54,7 +58,7 @@ demo = gr.ChatInterface(
|
|
54 |
respond,
|
55 |
additional_inputs=[
|
56 |
gr.Textbox(
|
57 |
-
value="
|
58 |
label="System message",
|
59 |
),
|
60 |
gr.Slider(minimum=200, maximum=100000, value=4000, step=100, label="Max new tokens"),
|
|
|
23 |
temperature,
|
24 |
top_p,
|
25 |
):
|
26 |
+
if len(system_message) > 0:
|
27 |
+
messages = [{"role": "system", "content": system_message}]
|
28 |
+
else:
|
29 |
+
messages = []
|
30 |
+
|
31 |
|
32 |
for val in history:
|
33 |
if val[0]:
|
|
|
58 |
respond,
|
59 |
additional_inputs=[
|
60 |
gr.Textbox(
|
61 |
+
value="",
|
62 |
label="System message",
|
63 |
),
|
64 |
gr.Slider(minimum=200, maximum=100000, value=4000, step=100, label="Max new tokens"),
|