Update app.py
Browse files
app.py
CHANGED
|
@@ -151,4 +151,19 @@ body { background: #f5f7fb; }
|
|
| 151 |
max_tokens = gr.Slider(64, 2048, value=DEFAULT_MAX_TOKENS, step=64, label="Max Tokens")
|
| 152 |
|
| 153 |
def on_send(msg, history, sys_prompt, model, temp, max_toks):
|
| 154 |
-
new_history, err = chat_step(msg,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 151 |
max_tokens = gr.Slider(64, 2048, value=DEFAULT_MAX_TOKENS, step=64, label="Max Tokens")
|
| 152 |
|
| 153 |
def on_send(msg, history, sys_prompt, model, temp, max_toks):
|
| 154 |
+
new_history, err = chat_step(msg, history, sys_prompt, model, temp, max_toks)
|
| 155 |
+
html = render_chat_html(new_history)
|
| 156 |
+
return new_history, html, err, ""
|
| 157 |
+
|
| 158 |
+
send_btn.click(
|
| 159 |
+
on_send,
|
| 160 |
+
inputs=[user_input, chat_state, system_prompt, model_select, temperature, max_tokens],
|
| 161 |
+
outputs=[chat_state, chat_area, error_output, user_input]
|
| 162 |
+
)
|
| 163 |
+
|
| 164 |
+
reset_btn.click(lambda: ([], render_chat_html([]), "", ""), outputs=[chat_state, chat_area, error_output, user_input])
|
| 165 |
+
|
| 166 |
+
gr.Markdown("<div class='footer'>© 2025 Corporate AI • Powered by Groq</div>")
|
| 167 |
+
|
| 168 |
+
if __name__ == "__main__":
|
| 169 |
+
demo.launch()
|