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

Getting this built for Fedora 41 #1671

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,19 @@ add_library(vosk
src/postprocessor.cc
)

find_package(kaldi REQUIRED)
if(BuildForFedora)
# Version used used by Fedora 41 is 1.83
# TODO: Detect the right version and put it here.
add_definitions(-DOPENFST_VER=18300)
find_package(kaldi REQUIRED)

# Small Hack for FindKaldi that does not provide the include directory
set(kaldi_INCLUDE_DIRS "${kaldi_DIR}/../../../include")
target_include_directories(vosk PUBLIC ${kaldi_INCLUDE_DIRS} "${kaldi_DIR}/../../../include/kaldi")

include_directories(/usr/include)
endif()

target_link_libraries(vosk PUBLIC kaldi-base kaldi-online2 kaldi-rnnlm fstngram)

include(GNUInstallDirs)
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ transcription for lectures and interviews.
Vosk scales from small devices like Raspberry Pi or Android smartphone to
big clusters.

# Building for Fedora 41 or later

In order to build it on Fedora 41 using the libraries that are provided by the distro, you need to install kaldi, after building from the source (no kaldi packages for fedora exist).

then build the package as follows:

```
cmake -S ./ -Bbuild/Release -DBuildForFedora=ON -DBUILD_SHARED_LIBS=ON
cmake --build ./build/Release
```


# Documentation

For installation instructions, examples and documentation visit [Vosk
Expand Down
2 changes: 1 addition & 1 deletion src/recognizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ const char* Recognizer::PartialResult()

clat = decoder_->GetLattice(decoder_->NumFramesInLattice(), false);
if (model_->winfo_) {
WordAlignLatticePartial(clat, *model_->trans_model_, *model_->winfo_, 0, &aligned_lat);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry, why do you change this? It is critical for functionality. Your kaldi changes in kaldi-asr/kaldi#4963 are also breaking things since we use different openfst version (our own branch) from Kaldi.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it did not compile: Error: ‘WordAlignLatticePartial’ was not declared in this scope

So how would fix this then?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me look at the test...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to merge this patch into main kaldi. And probably other changes from our vosk branch

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WordAlignLattice(clat, *model_->trans_model_, *model_->winfo_, 0, &aligned_lat);
} else {
CopyLatticeForMbr(clat, &aligned_lat);
}
Expand Down