Spaces:
Runtime error
Runtime error
Commit
·
7130cdb
1
Parent(s):
f7c67ea
Update app.py
Browse files
app.py
CHANGED
|
@@ -90,6 +90,13 @@ def format_chat_prompt(message: str, chat_history, bot_name: str) -> str:
|
|
| 90 |
|
| 91 |
|
| 92 |
def chat():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
with gr.Row(elem_id="param_container"):
|
| 94 |
with gr.Column():
|
| 95 |
model, temperature, top_p = parameter_accordion()
|
|
@@ -102,7 +109,8 @@ def chat():
|
|
| 102 |
interactive=True,
|
| 103 |
label="Character",
|
| 104 |
)
|
| 105 |
-
|
|
|
|
| 106 |
with gr.Column(elem_id="chat_container"):
|
| 107 |
with gr.Row():
|
| 108 |
chatbot = gr.Chatbot(elem_id="chatbot")
|
|
@@ -193,14 +201,6 @@ def get_demo():
|
|
| 193 |
min-height: 300px;
|
| 194 |
}"""
|
| 195 |
) as demo:
|
| 196 |
-
gr.HTML(TITLE)
|
| 197 |
-
|
| 198 |
-
with gr.Row():
|
| 199 |
-
with gr.Column():
|
| 200 |
-
gr.Image("home-banner.jpg", elem_id="banner-image", show_label=False)
|
| 201 |
-
with gr.Column():
|
| 202 |
-
gr.Markdown(INTRO)
|
| 203 |
-
|
| 204 |
chat()
|
| 205 |
|
| 206 |
return demo
|
|
|
|
| 90 |
|
| 91 |
|
| 92 |
def chat():
|
| 93 |
+
gr.HTML(TITLE)
|
| 94 |
+
with gr.Row():
|
| 95 |
+
with gr.Column():
|
| 96 |
+
banner = gr.Image("Albert Einstein.jpeg", elem_id="banner-image", show_label=False)
|
| 97 |
+
with gr.Column():
|
| 98 |
+
gr.Markdown(INTRO)
|
| 99 |
+
|
| 100 |
with gr.Row(elem_id="param_container"):
|
| 101 |
with gr.Column():
|
| 102 |
model, temperature, top_p = parameter_accordion()
|
|
|
|
| 109 |
interactive=True,
|
| 110 |
label="Character",
|
| 111 |
)
|
| 112 |
+
bot_name.change(fn=lambda value: gr.update(value=f"{value}.jpeg"}), inputs=bot_name, outputs=banner)
|
| 113 |
+
|
| 114 |
with gr.Column(elem_id="chat_container"):
|
| 115 |
with gr.Row():
|
| 116 |
chatbot = gr.Chatbot(elem_id="chatbot")
|
|
|
|
| 201 |
min-height: 300px;
|
| 202 |
}"""
|
| 203 |
) as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 204 |
chat()
|
| 205 |
|
| 206 |
return demo
|