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

Function load_model

tools/xtuner_streamlit_demo.py:167–173  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

165
166@st.cache_resource
167def load_model():
168 model = (AutoModelForCausalLM.from_pretrained(model_name_or_path,
169 trust_remote_code=True).to(
170 torch.bfloat16).cuda())
171 tokenizer = AutoTokenizer.from_pretrained(model_name_or_path,
172 trust_remote_code=True)
173 return model, tokenizer
174
175
176def prepare_generation_config():

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected