MCPcopy Create free account
hub / github.com/InternLM/Tutorial / prepare_generation_config

Function prepare_generation_config

tools/xtuner_streamlit_demo.py:176–190  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

174
175
176def prepare_generation_config():
177 with st.sidebar:
178 max_length = st.slider('Max Length',
179 min_value=8,
180 max_value=32768,
181 value=2048)
182 top_p = st.slider('Top P', 0.0, 1.0, 0.75, step=0.01)
183 temperature = st.slider('Temperature', 0.0, 1.0, 0.1, step=0.01)
184 st.button('Clear Chat History', on_click=on_btn_click)
185
186 generation_config = GenerationConfig(max_length=max_length,
187 top_p=top_p,
188 temperature=temperature)
189
190 return generation_config
191
192
193user_prompt = '<|im_start|>user\n{user}<|im_end|>\n'

Callers 1

mainFunction · 0.70

Calls 1

GenerationConfigClass · 0.70

Tested by

no test coverage detected