daanzu / kaldi-active-grammar

Python Kaldi speech recognition with grammars that can be set active/inactive dynamically at decode-time
GNU Affero General Public License v3.0
334 stars 49 forks source link

Python 3.8 'time.clock()' removed #15

Closed LexiconCode closed 4 years ago

LexiconCode commented 4 years ago

Python: 3.8 Caster: (Py 3 pull request) kaldi_module_loader_plus: latest dragonfly master kaldi_active_grammar: 1.2

Traceback (most recent call last):
  File "kaldi_module_loader_plus.py", line 156, in <module>
    main()
  File "kaldi_module_loader_plus.py", line 150, in main
    engine.do_recognition(on_begin, on_recognition, on_failure)
  File "C:\Users\Laptop\AppData\Local\Programs\Python\Python38\lib\site-packages\dragonfly\engines\base\engine.py", line 242, in do_recognition
    self._do_recognition(*args, **kwargs)
  File "C:\Users\Laptop\AppData\Local\Programs\Python\Python38\lib\site-packages\dragonfly\engines\backend_kaldi\engine.py", line 309, in _do_recognition
    self._decoder.decode(block, False, kaldi_rules_activity)
  File "C:\Users\Laptop\AppData\Local\Programs\Python\Python38\lib\site-packages\kaldi_active_grammar\wrapper.py", line 445, in decode
    self._start_decode_time(len(frames))
  File "C:\Users\Laptop\AppData\Local\Programs\Python\Python38\lib\site-packages\kaldi_active_grammar\wrapper.py", line 64, in _start_decode_time
    self.decode_start_time = time.clock()
AttributeError: module 'time' has no attribute 'clock'

time.clock() has been deprecated since Python 3.3

daanzu commented 4 years ago

Thanks! Should be fixed in master and the next version.