Spaces:
Runtime error
Runtime error
X commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -59,7 +59,7 @@ def generate_response(message, history, username, current_chat_id):
|
|
| 59 |
if not message.strip():
|
| 60 |
return history, gr.update(), current_chat_id
|
| 61 |
|
| 62 |
-
#
|
| 63 |
history = history + [{"role": "user", "content": message}]
|
| 64 |
|
| 65 |
# Формируем промпт из всей истории
|
|
@@ -178,7 +178,7 @@ CUSTOM_CSS = """
|
|
| 178 |
"""
|
| 179 |
|
| 180 |
# === ИНТЕРФЕЙС ===
|
| 181 |
-
with gr.Blocks(
|
| 182 |
|
| 183 |
# Состояния
|
| 184 |
username_state = gr.State("")
|
|
@@ -217,8 +217,7 @@ with gr.Blocks(css=CUSTOM_CSS, title="OpenAirAI-X Chat") as demo:
|
|
| 217 |
with gr.Column(scale=3):
|
| 218 |
chatbot = gr.Chatbot(
|
| 219 |
label="Диалог",
|
| 220 |
-
height=500
|
| 221 |
-
type="messages"
|
| 222 |
)
|
| 223 |
with gr.Row():
|
| 224 |
msg_input = gr.Textbox(
|
|
@@ -350,4 +349,5 @@ with gr.Blocks(css=CUSTOM_CSS, title="OpenAirAI-X Chat") as demo:
|
|
| 350 |
history_state, current_chat_id_state, chat_list, pro_badge]
|
| 351 |
)
|
| 352 |
|
| 353 |
-
|
|
|
|
|
|
| 59 |
if not message.strip():
|
| 60 |
return history, gr.update(), current_chat_id
|
| 61 |
|
| 62 |
+
# Добавляем сообщение пользователя
|
| 63 |
history = history + [{"role": "user", "content": message}]
|
| 64 |
|
| 65 |
# Формируем промпт из всей истории
|
|
|
|
| 178 |
"""
|
| 179 |
|
| 180 |
# === ИНТЕРФЕЙС ===
|
| 181 |
+
with gr.Blocks(title="OpenAirAI-X Chat") as demo:
|
| 182 |
|
| 183 |
# Состояния
|
| 184 |
username_state = gr.State("")
|
|
|
|
| 217 |
with gr.Column(scale=3):
|
| 218 |
chatbot = gr.Chatbot(
|
| 219 |
label="Диалог",
|
| 220 |
+
height=500
|
|
|
|
| 221 |
)
|
| 222 |
with gr.Row():
|
| 223 |
msg_input = gr.Textbox(
|
|
|
|
| 349 |
history_state, current_chat_id_state, chat_list, pro_badge]
|
| 350 |
)
|
| 351 |
|
| 352 |
+
# Запуск с CSS в launch()
|
| 353 |
+
demo.launch(server_name="0.0.0.0", server_port=7860, css=CUSTOM_CSS)
|