|
1 | 1 | import os
|
2 |
| -import time |
3 | 2 |
|
4 | 3 | import streamlit as st
|
5 | 4 | import streamlit_toggle as st_toggle
|
|
60 | 59 | help=_('What sampling temperature to use, between 0 and 1. Higher values like 0.8 will make the '
|
61 | 60 | 'output more random, while lower values like 0.2 will make it more focused and '
|
62 | 61 | 'deterministic. \n\nIt is generally recommend altering this or `top_p` but not both.'))
|
63 |
| - max_tokens = st.slider(_('Max Tokens'), 850, 4096, value=util.read_json_at(INFO.BRAIN_MEMO, 'max_tokens', 1000), |
| 62 | + max_tokens = st.slider(_('Max Tokens'), 10, 4096, value=util.read_json_at(INFO.BRAIN_MEMO, 'max_tokens', 1000), |
64 | 63 | help=_("The maximum number of tokens to generate in the completion.\n\nThe token count of "
|
65 | 64 | "your prompt plus `max_tokens` cannot exceed the model's context length. Most "
|
66 | 65 | "models have a context length of 2048 tokens (except for the newest models, "
|
67 | 66 | "which support 4096)."))
|
| 67 | + chunk_size = st.slider(_('Chunk size'), 1500, 4500, |
| 68 | + value=util.read_json_at(INFO.BRAIN_MEMO, 'chunk_size', 4000), |
| 69 | + help=_("The number of tokens to consider at each step. The larger this is, the more " |
| 70 | + "context the model has to work with, but the slower generation and expensive " |
| 71 | + "will it be.")) |
68 | 72 |
|
69 | 73 | with st.expander(label=_('Advanced Options')):
|
70 | 74 | top_p = st.slider(_('Top_P'), 0.0, 1.0, value=util.read_json_at(INFO.BRAIN_MEMO, 'top_p', 1.0),
|
|
84 | 88 | "new tokens based on their existing frequency in the text so far."
|
85 | 89 | "\n\n[See more information about frequency and presence penalties.]"
|
86 | 90 | "(https://platform.openai.com/docs/api-reference/parameter-details)"))
|
87 |
| - |
88 |
| - chunk_size = st.slider(_('Chunk size'), 1500, 4500, |
89 |
| - value=util.read_json_at(INFO.BRAIN_MEMO, 'chunk_size', 4000), |
90 |
| - help=_("The number of tokens to consider at each step. The larger this is, the more " |
91 |
| - "context the model has to work with, but the slower generation and expensive " |
92 |
| - "will it be.")) |
93 | 91 | enable_stream = st_toggle.st_toggle_switch(_('Stream (experimental)'),
|
94 | 92 | default_value=util.read_json_at(INFO.BRAIN_MEMO, 'enable_stream',
|
95 |
| - True)) |
| 93 | + False)) |
96 | 94 |
|
97 | 95 | if not enable_stream:
|
98 | 96 | chunk_count = st.slider(_('Answer count'), 1, 5, value=util.read_json_at(INFO.BRAIN_MEMO, 'chunk_count', 1),
|
|
0 commit comments