MCPcopy Index your code
hub / github.com/InternLM/Tutorial / load_model

Function load_model

tools/streamlit_demo.py:183–190  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

181
182@st.cache_resource
183def load_model():
184 model = (AutoModelForCausalLM.from_pretrained(
185 '/share/new_models/Shanghai_AI_Laboratory/internlm2-chat-1_8b',
186 trust_remote_code=True).to(torch.bfloat16).cuda())
187 tokenizer = AutoTokenizer.from_pretrained(
188 '/share/new_models/Shanghai_AI_Laboratory/internlm2-chat-1_8b',
189 trust_remote_code=True)
190 return model, tokenizer
191
192
193def prepare_generation_config():

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected