Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,9 @@ def respond(
|
|
16 |
top_p
|
17 |
#repetition_penalty
|
18 |
):
|
19 |
-
messages = [
|
|
|
|
|
20 |
|
21 |
for val in history:
|
22 |
if val[0]:
|
@@ -48,7 +50,7 @@ For information on how to customize the ChatInterface, peruse the gradio docs: h
|
|
48 |
demo = gr.ChatInterface(
|
49 |
respond,
|
50 |
additional_inputs=[
|
51 |
-
gr.Textbox(value="
|
52 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
53 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.3, step=0.1, label="Temperature"),
|
54 |
gr.Slider(
|
|
|
16 |
top_p
|
17 |
#repetition_penalty
|
18 |
):
|
19 |
+
messages = []
|
20 |
+
if len(system_message.strip()) > 0:
|
21 |
+
messages = [{"role": "system", "content": system_message}]
|
22 |
|
23 |
for val in history:
|
24 |
if val[0]:
|
|
|
50 |
demo = gr.ChatInterface(
|
51 |
respond,
|
52 |
additional_inputs=[
|
53 |
+
gr.Textbox(value="", label="System message"),
|
54 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
55 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.3, step=0.1, label="Temperature"),
|
56 |
gr.Slider(
|