mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
update repo
This commit is contained in:
parent
a17c5cc3e7
commit
e2f8fa4b64
@ -74,7 +74,10 @@ def build_model_from_file(
|
||||
model_dict = torch.load(model_file, map_location=device)
|
||||
if task_name == "diar" and mode == "sond":
|
||||
model_dict = fileter_model_dict(model_dict, model.state_dict())
|
||||
model.load_state_dict(model_dict)
|
||||
if task_name == "vad":
|
||||
model.encoder.load_state_dict(model_dict)
|
||||
else:
|
||||
model.load_state_dict(model_dict)
|
||||
if model_name_pth is not None and not os.path.exists(model_name_pth):
|
||||
torch.save(model_dict, model_name_pth)
|
||||
logging.info("model_file is saved to pth: {}".format(model_name_pth))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user