mmcauliffe / kalpy Goto Github PK
View Code? Open in Web Editor NEWPybind11 bindings for Kaldi
License: MIT License
Pybind11 bindings for Kaldi
License: MIT License
Hi, I failed to install kalpy by conda install kalpy
somehow
then I use python3 setup install
at kalpy root dir, after install kaldi toolkit successfully,
but got Error :can't find file _pywrapfst.h,
I checked https://github.com/conda-forge/pynini-feedstock and https://github.com/kylebgorman/pynini/tree/master/extensions
where can I find this file ? thank you !
First of all, thank you for putting in so much work into this wonderful solution. It makes life easier being able to use Python to interface with Kaldi instead of having to string together commands all the time - this is nice!
Debugging checklist
[X --> v0.6.0] Have you updated to latest Kalpy version?
Describe the issue
During an attempt to make a simple function to align text to audio without any temp files (using GmmAligner.align_utterance), I encountered kaldi::KaldiFatalError during alignment, and couldn't trace the issue further.
For Reproducing your issue
All files involved in my testing are in the Drive folder here:
kalpy_testing/gh_raw_files
is a copy paste from this repository's testing/data
folder.kalpy_testing/acoustic_model
is the extracted acoustic model files for English (US) ARPA acoustic model v2.0.0
kalpy_testing/acoustic_model_mfa
is the extracted acoustic model files for English MFA acoustic model v2.2.1
test.py
file is the python script I wrote, which you can run to reproduce the errors.Extract the entire folder somewhere and make sure the file structure is the same as in the Drive folder.
Environment:
Run conda install -c conda-forge kalpy
if you don't already have. (I used v0.6.0, since it is the latest version on conda-forge).
Run python test.py
This should reproduce the outputs:
Running custom forced alignment with no temp files...
Initializing lexicon...
Initializing aligner...
Initializing feature generator...
Performing forced alignment...
Computing features...
Compiling training graph...
Performing alignment...
Traceback (most recent call last):
File "/app/test.py", line 242, in <module>
align_one(input_wav, input_align_text, feature_generator, training_graph_compiler, aligner)
File "/app/test.py", line 155, in align_one
alignment = aligner.align_utterance(
File "/env/lib/python3.10/site-packages/kalpy/gmm/align.py", line 72, in align_utterance
) = gmm_align_compiled(
RuntimeError: kaldi::KaldiFatalError
Additional context
I ran all of this in a GPU enabled Docker container on Ubuntu with Python v3.10.
I was ALMOST able to run the test in the repository test_align_sat_first_pass
using the data in the kalpy_testing/gh_raw_files/kaldi
folder corresponding to tests/data/kaldi
in the repo (this is in the python file in the Drive folder I provided). The alignment was generated, but LexiconCompiler.phones_to_pronunciations
failed to run, dumping the following error:
ERROR: SymbolStringToLabels: Symbol "" is not mapped to any integer label in symbol table <unspecified>
ERROR: Failed to compile string ` be be `, with token_type: symbol
I was NOT able to run the test in the repository test_align
, and got the same RuntimeError: kaldi::KaldiFatalError
as in my custom function.
I tried with two different dictionary+acoustic combinations:
Again, thank you for your work. I have used MFA for the past several months in projects, and am excited to get kalpy to work for even better interfacing with kaldi!
Can we install this without conda?
I was trying pip install kalpy-kaldi
that didn't work, also tried to build this with pip3 install .
also python3 setup.py build
which was most helpful since it complained about not seeing headers from kaldi:
/opt/kalpy/extensions/chain/pybind_chain.h:6:10: fatal error: chain/chain-datastruct.h: No such file or directory
6 | #include "chain/chain-datastruct.h"
despite having set
export KALDI_ROOT="/opt/kaldi"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"$KALDI_ROOT/src/lib"
I'm not using conda because I want to build this inside docker for aarch64, so conda doesn't work very well...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.