Skip to content

Commit

Permalink
[fix] fix cli pt model loading
Browse files Browse the repository at this point in the history
  • Loading branch information
robin1001 committed Jan 10, 2025
1 parent e296cf2 commit f84147c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion wenet/cli/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import argparse
import os

import torch
Expand Down Expand Up @@ -204,6 +205,7 @@ def load_model_pt(model_dir):
configs['cmvn_conf']['cmvn_file'] = cmvn_file
# Read model
pt_file = os.path.join(model_dir, 'final.pt')
args = {'checkpoint': pt_file}
args = argparse.Namespace()
args.checkpoint = pt_file
model, configs = init_model(args, configs)
return model

0 comments on commit f84147c

Please sign in to comment.