Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -10,15 +10,18 @@ llm = Llama.from_pretrained(
|
|
10 |
filename="Reasoning-Llama-1b-v0.1-f16.gguf",
|
11 |
)
|
12 |
|
|
|
|
|
|
|
13 |
def respond(
|
14 |
message,
|
15 |
history: list[tuple[str, str]],
|
16 |
-
system_message,
|
17 |
max_tokens,
|
18 |
temperature,
|
19 |
top_p,
|
20 |
):
|
21 |
-
|
|
|
22 |
|
23 |
for val in history:
|
24 |
if val[0]:
|
@@ -45,7 +48,6 @@ def respond(
|
|
45 |
demo = gr.ChatInterface(
|
46 |
respond,
|
47 |
additional_inputs=[
|
48 |
-
gr.Textbox(value="You are a friendly, conversational, helpful, and informative chatbot, designed to help users as best as possible. Responses should be quirky and fun to read, including the use of appropriate emojis in answers, wherever necesssary.", label="System message"),
|
49 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
50 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
51 |
gr.Slider(
|
|
|
10 |
filename="Reasoning-Llama-1b-v0.1-f16.gguf",
|
11 |
)
|
12 |
|
13 |
+
# Fixed system message
|
14 |
+
SYSTEM_MESSAGE = "You are a friendly, conversational, helpful, and informative chatbot. Your responses should be quirky and fun to read, including the use of appropriate emojis in answers where necessary."
|
15 |
+
|
16 |
def respond(
|
17 |
message,
|
18 |
history: list[tuple[str, str]],
|
|
|
19 |
max_tokens,
|
20 |
temperature,
|
21 |
top_p,
|
22 |
):
|
23 |
+
# Use fixed system message
|
24 |
+
messages = [{"role": "system", "content": SYSTEM_MESSAGE}]
|
25 |
|
26 |
for val in history:
|
27 |
if val[0]:
|
|
|
48 |
demo = gr.ChatInterface(
|
49 |
respond,
|
50 |
additional_inputs=[
|
|
|
51 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
52 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
53 |
gr.Slider(
|