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

Bug: Scorer.fill_dictiomary() Python function throws SWIG exception #2305

Open
comodoro opened this issue Oct 21, 2022 · 0 comments
Open

Bug: Scorer.fill_dictiomary() Python function throws SWIG exception #2305

comodoro opened this issue Oct 21, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@comodoro
Copy link
Contributor

Python SWIG binding for the funczion Scorer::fill_dictionary does not work (it did in the old Mozilla code).

I am trying to make a fork of Mozilla DSAlign work with custom language models and got stuck on line https://github.com/comodoro/STT-align/blob/b5ef6f81fdb4b608a6cf2ba09f7d35a10f39ce25/align/generate_package.py#L74.

To Reproduce
Steps to reproduce the behavior:
Import Scorer from coqui_stt_ctcdecoder and try to run scorer.fill_dictionary
In my case the error was

raceback (most recent call last):
  File "/mnt/d/shared/speech/dsalign/STT-align/align/align.py", line 693, in <module>
    main()
  File "/mnt/d/shared/speech/dsalign/STT-align/align/align.py", line 451, in main
    create_bundle(alphabet_path, scorer_path + '.' + 'lm.binary', scorer_path + '.' + 'vocab-500000.txt', scorer_path, False, 0.931289039105002, 1.1834137581510284)
  File "/mnt/d/shared/speech/dsalign/STT-align/align/generate_package.py", line 75, in create_bundle
    scorer.fill_dictionary(words)
  File "/mnt/d/shared/speech/dsalign/STT-align/venv/lib/python3.10/site-packages/coqui_stt_ctcdecoder/swigwrapper.py", line 1269, in fill_dictionary
    return _swigwrapper.Scorer_fill_dictionary(self, vocabulary)
TypeError: in method 'Scorer_fill_dictionary', argument 2 of type 'std::unordered_set< std::string > const &'

Expected behavior
The function works same as in the C++ code on a list or maybe set.

Environment (please complete the following information):

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
  • Windows 10 and WSL, not tried on Linux proper
  • TensorFlow installed from (our builds, or upstream TensorFlow):
  • TensorFlow version (use command below):
  • Python version: 3.8.9/10
  • Bazel version (if compiling from source):
  • GCC/Compiler version (if compiling from source):
  • CUDA/cuDNN version:
  • GPU model and memory:
  • Exact command to reproduce:

Additional context
I had posted it as a SO question: https://stackoverflow.com/questions/73900661/using-swig-python-wrapper-argument-2-of-type-stdunordered-set-stdstring. As I understand it, a templare needs to be added to swigwrapper.i

@comodoro comodoro added the bug Something isn't working label Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant