Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run kaldilm issue #25

Open
alidabaghi123 opened this issue Dec 25, 2022 · 11 comments
Open

run kaldilm issue #25

alidabaghi123 opened this issue Dec 25, 2022 · 11 comments

Comments

@alidabaghi123
Copy link

hello, how are you?
I ran kaldilm with github and occurrence this error?
what do i?
Screenshot from 2022-12-25 12-16-01

@csukuangfj
Copy link
Owner

Could you show the code?

Also, could you check the file size of your arpa file and make sure it is not empty?

@alidabaghi123
Copy link
Author

I use self github for test running
Screenshot from 2022-12-25 13-09-36

@alidabaghi123
Copy link
Author

import k2
G = k2.Fsa.from_openfst(G_fst_txt, acceptor=False)
G.labels_sym = k2.SymbolTable.from_file('words.txt')
G.aux_labels_sym = k2.SymbolTable.from_file('words.txt')
#G.labels[G.labels >= 3] = 0 # convert symbols with ID >= ID of #0 to eps
G.draw('G.svg', title='G')

@csukuangfj
Copy link
Owner

What is the output of

ls -lh G_fst.txt

and

head -n 10 G_fst.txt

@alidabaghi123
Copy link
Author

Screenshot from 2022-12-25 13-41-35

@csukuangfj
Copy link
Owner

And what is the output of

python3 -m k2.version

?

@alidabaghi123
Copy link
Author

Screenshot from 2022-12-25 13-44-58

@csukuangfj
Copy link
Owner

G = k2.Fsa.from_openfst(G_fst_txt, acceptor=False)

Please replace it with

with open(G_fst_txt) as f:
  G = k2.Fsa.from_openfst(f.read(), acceptor=False)

@csukuangfj
Copy link
Owner

I am updating README.md so that it won't cause errors for future users.

@alidabaghi123
Copy link
Author

very thanks. you are excellent.

@csukuangfj
Copy link
Owner

By the way, readme.md has been updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants