Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -40,7 +40,24 @@ def generate(
|
|
40 |
|
41 |
|
42 |
mychatbot = gr.Chatbot(
|
43 |
-
avatar_images=["./user.png", "./botm.png"],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
demo = gr.ChatInterface(fn=generate,
|
46 |
chatbot=mychatbot,
|
|
|
40 |
|
41 |
|
42 |
mychatbot = gr.Chatbot(
|
43 |
+
avatar_images=["./user.png", "./botm.png"],
|
44 |
+
bubble_full_width=False,
|
45 |
+
show_label=False,
|
46 |
+
show_copy_button=True,
|
47 |
+
likeable=True,
|
48 |
+
)
|
49 |
+
|
50 |
+
def echo(message, history, system_prompt):
|
51 |
+
# Use the system prompt to modify the model's behavior
|
52 |
+
# For example, you can prepend the system prompt to the message
|
53 |
+
# Or you can use it to control some parameters of the model
|
54 |
+
# Here we just return the system prompt and the message as a simple example
|
55 |
+
return f"{system_prompt}: {message}"
|
56 |
+
|
57 |
+
with gr.Blocks() as demo:
|
58 |
+
system_prompt = gr.Textbox("You are helpful AI.", label="System Prompt", render=False)
|
59 |
+
gr.ChatInterface(echo, additional_inputs=[system_prompt], chatbot=mychatbot).launch()
|
60 |
+
|
61 |
|
62 |
demo = gr.ChatInterface(fn=generate,
|
63 |
chatbot=mychatbot,
|