MCPcopy Create free account
hub / github.com/ASLP-lab/OSUM / init_model_my

Function init_model_my

OSUM/infer_gradio.py:46–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44
45gpu_id = 4
46def init_model_my():
47 logging.basicConfig(level=logging.DEBUG,
48 format='%(asctime)s %(levelname)s %(message)s')
49 config_path = "conf/config_llm_huawei_base-version.yaml"
50 checkpoint_path = "***"
51 args = GxlNode({
52 "checkpoint": checkpoint_path,
53 })
54 configs = utils_file.load_dict_from_yaml(config_path)
55 model, configs = init_model(args, configs)
56 model = model.cuda(gpu_id)
57 tokenizer = init_tokenizer(configs)
58 print(model)
59 return model, tokenizer
60
61model, tokenizer = init_model_my()
62

Callers 1

infer_gradio.pyFile · 0.85

Calls 2

init_modelFunction · 0.90
init_tokenizerFunction · 0.90

Tested by

no test coverage detected