wenet icon indicating copy to clipboard operation
wenet copied to clipboard

wenet --language chinese audio.wav

Open icestoneking opened this issue 1 year ago • 2 comments

TypeError: integer argument expected, got float

icestoneking avatar Jun 26 '24 03:06 icestoneking

plz supply more info

Mddct avatar Jun 27 '24 13:06 Mddct

@Mddct https://github.com/wenet-e2e/wenet/blob/dec409bf9c6fd6280fb04abc02ea7470ff6114b7/wenet/cli/model.py#L172 there is a parameters error in this line

azraelkuan avatar Jun 28 '24 03:06 azraelkuan

@Mddct @azraelkuan 我也碰到这个问题,请问怎么解决? context_list_path这个文件是什么文件?有示例吗?

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "wenet/wenet/cli/model.py", line 172, in load_model
    model = Model(model_dir, beam, context_path, context_score)
  File "wenet/wenet/cli/model.py", line 54, in __init__
    self.context_graph = ContextGraph(context_path,
  File "wenet/wenet/utils/context_graph.py", line 130, in __init__
    self.context_list = tokenize(context_list_path, symbol_table,
  File "wenet/wenet/utils/context_graph.py", line 35, in tokenize
    with open(context_list_path, "r") as fin:
TypeError: expected str, bytes or os.PathLike object, not float

XiHenSuper avatar Jul 02 '24 06:07 XiHenSuper

@Mddct @azraelkuan 我也碰到这个问题,请问怎么解决? context_list_path这个文件是什么文件?有示例吗?

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "wenet/wenet/cli/model.py", line 172, in load_model
    model = Model(model_dir, beam, context_path, context_score)
  File "wenet/wenet/cli/model.py", line 54, in __init__
    self.context_graph = ContextGraph(context_path,
  File "wenet/wenet/utils/context_graph.py", line 130, in __init__
    self.context_list = tokenize(context_list_path, symbol_table,
  File "wenet/wenet/utils/context_graph.py", line 35, in tokenize
    with open(context_list_path, "r") as fin:
TypeError: expected str, bytes or os.PathLike object, not float

楼上的解决方案是对的,参数没对齐。model = Model(model_dir, beam, context_path, context_score)

icestoneking avatar Jul 05 '24 02:07 icestoneking

plz see https://github.com/wenet-e2e/wenet/pull/2563

Mddct avatar Jul 05 '24 12:07 Mddct