| 265 | |
| 266 | @cl.on_chat_start |
| 267 | async def start(): |
| 268 | settings = await cl.ChatSettings( |
| 269 | [ |
| 270 | Select( |
| 271 | id="model", |
| 272 | label="Model", |
| 273 | values=["llava-v1.5-13b"], |
| 274 | initial_index=0, |
| 275 | ), |
| 276 | Slider( |
| 277 | id="temperature", |
| 278 | label="Temperature", |
| 279 | initial=0, |
| 280 | min=0, |
| 281 | max=1, |
| 282 | step=0.1, |
| 283 | ), |
| 284 | Slider( |
| 285 | id="top_p", |
| 286 | label="Top P", |
| 287 | initial=0.7, |
| 288 | min=0, |
| 289 | max=1, |
| 290 | step=0.1, |
| 291 | ), |
| 292 | Slider( |
| 293 | id="max_token", |
| 294 | label="Max output tokens", |
| 295 | initial=512, |
| 296 | min=0, |
| 297 | max=1024, |
| 298 | step=64, |
| 299 | ), |
| 300 | ] |
| 301 | ).send() |
| 302 | |
| 303 | conversation = default_conversation.copy() |
| 304 | |
| 305 | cl.user_session.set("conversation", conversation) |
| 306 | cl.user_session.set("settings", settings) |
| 307 | |
| 308 | |
| 309 | @cl.on_settings_update |