MCPcopy
hub / github.com/InternLM/Tutorial / prepare_generation_config

Function prepare_generation_config

tools/streamlit_demo.py:193–207  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

191
192
193def prepare_generation_config():
194 with st.sidebar:
195 max_length = st.slider('Max Length',
196 min_value=8,
197 max_value=32768,
198 value=32768)
199 top_p = st.slider('Top P', 0.0, 1.0, 0.8, step=0.01)
200 temperature = st.slider('Temperature', 0.0, 1.0, 0.7, step=0.01)
201 st.button('Clear Chat History', on_click=on_btn_click)
202
203 generation_config = GenerationConfig(max_length=max_length,
204 top_p=top_p,
205 temperature=temperature)
206
207 return generation_config
208
209
210user_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