Fix building for Pascal (#2305)
This commit is contained in:
@@ -7,3 +7,13 @@ for how to build the project in this directory.
|
||||
You can find pre-built APPs from this directory at
|
||||
https://k2-fsa.github.io/sherpa/onnx/lazarus/pre-built-app.html
|
||||
|
||||
|
||||
|
||||
## notes for developers
|
||||
|
||||
By default, it uses static libs for Linux and macOS. To change that,
|
||||
open Lazarus IDE, select `Project`, `Project options`, `Compiler options`,
|
||||
change the `Build modes` to `Release-Linux`.
|
||||
|
||||
The `Release-Linux` mode is defined in the file `generate_subtitles.lpi`.
|
||||
It defines a macro `SHERPA_ONNX_USE_SHARED_LIBS`.
|
||||
|
||||
@@ -193,6 +193,24 @@ def get_models():
|
||||
|
||||
ls -lh
|
||||
|
||||
popd
|
||||
""",
|
||||
),
|
||||
Model(
|
||||
model_name="sherpa-onnx-nemo-parakeet-tdt-0.6b-v2-int8",
|
||||
lang="en",
|
||||
short_name="parakeet_tdt_0.6b_v2",
|
||||
cmd="""
|
||||
pushd $model_name
|
||||
|
||||
rm -rfv test_wavs
|
||||
|
||||
mv -v encoder.int8.onnx nemo-transducer-encoder.onnx
|
||||
mv -v decoder.int8.onnx nemo-transducer-decoder.onnx
|
||||
mv -v joiner.int8.onnx nemo-transducer-joiner.onnx
|
||||
|
||||
ls -lh
|
||||
|
||||
popd
|
||||
""",
|
||||
),
|
||||
|
||||
@@ -195,6 +195,13 @@ type
|
||||
class operator Initialize({$IFDEF FPC}var{$ELSE}out{$ENDIF} Dest: TSherpaOnnxOnlineCtcFstDecoderConfig);
|
||||
end;
|
||||
|
||||
TSherpaOnnxHomophoneReplacerConfig = record
|
||||
DictDir: AnsiString;
|
||||
Lexicon: AnsiString;
|
||||
RuleFsts: AnsiString;
|
||||
function ToString: AnsiString;
|
||||
end;
|
||||
|
||||
TSherpaOnnxOnlineRecognizerConfig = record
|
||||
FeatConfig: TSherpaOnnxFeatureConfig;
|
||||
ModelConfig: TSherpaOnnxOnlineModelConfig;
|
||||
@@ -212,6 +219,7 @@ type
|
||||
BlankPenalty: Single;
|
||||
HotwordsBuf: AnsiString;
|
||||
HotwordsBufSize: Integer;
|
||||
Hr: TSherpaOnnxHomophoneReplacerConfig;
|
||||
function ToString: AnsiString;
|
||||
class operator Initialize({$IFDEF FPC}var{$ELSE}out{$ENDIF} Dest: TSherpaOnnxOnlineRecognizerConfig);
|
||||
end;
|
||||
@@ -352,6 +360,7 @@ type
|
||||
RuleFsts: AnsiString;
|
||||
RuleFars: AnsiString;
|
||||
BlankPenalty: Single;
|
||||
Hr: TSherpaOnnxHomophoneReplacerConfig;
|
||||
class operator Initialize({$IFDEF FPC}var{$ELSE}out{$ENDIF} Dest: TSherpaOnnxOfflineRecognizerConfig);
|
||||
function ToString: AnsiString;
|
||||
end;
|
||||
@@ -601,6 +610,7 @@ const
|
||||
{$linklib sherpa-onnx-kaldifst-core}
|
||||
{$linklib sherpa-onnx-fstfar}
|
||||
{$linklib sherpa-onnx-fst}
|
||||
{$linklib kissfft-float}
|
||||
{$linklib kaldi-native-fbank-core}
|
||||
{$linklib piper_phonemize}
|
||||
{$linklib espeak-ng}
|
||||
@@ -668,6 +678,13 @@ type
|
||||
Graph: PAnsiChar;
|
||||
MaxActive: cint32;
|
||||
end;
|
||||
|
||||
SherpaOnnxHomophoneReplacerConfig = record
|
||||
DictDir: PAnsiChar;
|
||||
Lexicon: PAnsiChar;
|
||||
RuleFsts: PAnsiChar;
|
||||
end;
|
||||
|
||||
SherpaOnnxOnlineRecognizerConfig = record
|
||||
FeatConfig: SherpaOnnxFeatureConfig;
|
||||
ModelConfig: SherpaOnnxOnlineModelConfig;
|
||||
@@ -685,6 +702,7 @@ type
|
||||
BlankPenalty: cfloat;
|
||||
HotwordsBuf: PAnsiChar;
|
||||
HotwordsBufSize: cint32;
|
||||
Hr: SherpaOnnxHomophoneReplacerConfig;
|
||||
end;
|
||||
|
||||
PSherpaOnnxOnlineRecognizerConfig = ^SherpaOnnxOnlineRecognizerConfig;
|
||||
@@ -763,6 +781,7 @@ type
|
||||
RuleFsts: PAnsiChar;
|
||||
RuleFars: PAnsiChar;
|
||||
BlankPenalty: cfloat;
|
||||
Hr: SherpaOnnxHomophoneReplacerConfig;
|
||||
end;
|
||||
|
||||
PSherpaOnnxOfflineRecognizerConfig = ^SherpaOnnxOfflineRecognizerConfig;
|
||||
@@ -1238,6 +1257,12 @@ begin
|
||||
[Self.Graph, Self.MaxActive]);
|
||||
end;
|
||||
|
||||
function TSherpaOnnxHomophoneReplacerConfig.ToString: AnsiString;
|
||||
begin
|
||||
Result := Format('TSherpaOnnxHomophoneReplacerConfig(DictDir := %s, Lexicon := %s, RuleFsts := %s)',
|
||||
[Self.DictDir, Self.Lexicon, Self.RuleFsts]);
|
||||
end;
|
||||
|
||||
function TSherpaOnnxOnlineRecognizerConfig.ToString: AnsiString;
|
||||
begin
|
||||
Result := Format('TSherpaOnnxOnlineRecognizerConfig(FeatConfig := %s, ' +
|
||||
@@ -1253,7 +1278,8 @@ begin
|
||||
'CtcFstDecoderConfig := %s, ' +
|
||||
'RuleFsts := %s, ' +
|
||||
'RuleFars := %s, ' +
|
||||
'BlankPenalty := %.1f' +
|
||||
'BlankPenalty := %.1f, ' +
|
||||
'Hr := %s' +
|
||||
')'
|
||||
,
|
||||
[Self.FeatConfig.ToString, Self.ModelConfig.ToString,
|
||||
@@ -1261,7 +1287,7 @@ begin
|
||||
Self.Rule1MinTrailingSilence, Self.Rule2MinTrailingSilence,
|
||||
Self.Rule3MinUtteranceLength, Self.HotwordsFile, Self.HotwordsScore,
|
||||
Self.CtcFstDecoderConfig.ToString, Self.RuleFsts, Self.RuleFars,
|
||||
Self.BlankPenalty
|
||||
Self.BlankPenalty, Self.Hr.ToString
|
||||
]);
|
||||
end;
|
||||
|
||||
@@ -1336,6 +1362,9 @@ begin
|
||||
C.RuleFsts := PAnsiChar(Config.RuleFsts);
|
||||
C.RuleFars := PAnsiChar(Config.RuleFars);
|
||||
C.BlankPenalty := Config.BlankPenalty;
|
||||
C.Hr.DictDir := PAnsiChar(Config.Hr.DictDir);
|
||||
C.Hr.Lexicon := PAnsiChar(Config.Hr.Lexicon);
|
||||
C.Hr.RuleFsts := PAnsiChar(Config.Hr.RuleFsts);
|
||||
|
||||
Self.Handle := SherpaOnnxCreateOnlineRecognizer(@C);
|
||||
Self._Config := Config;
|
||||
@@ -1574,12 +1603,13 @@ begin
|
||||
'HotwordsScore := %.1f, ' +
|
||||
'RuleFsts := %s, ' +
|
||||
'RuleFars := %s, ' +
|
||||
'BlankPenalty := %1.f' +
|
||||
'BlankPenalty := %1.f, ' +
|
||||
'Hr := %s' +
|
||||
')',
|
||||
[Self.FeatConfig.ToString, Self.ModelConfig.ToString,
|
||||
Self.LMConfig.ToString, Self.DecodingMethod, Self.MaxActivePaths,
|
||||
Self.HotwordsFile, Self.HotwordsScore, Self.RuleFsts, Self.RuleFars,
|
||||
Self.BlankPenalty
|
||||
Self.BlankPenalty, Self.Hr.ToString
|
||||
]);
|
||||
end;
|
||||
|
||||
@@ -1640,6 +1670,10 @@ begin
|
||||
C.RuleFars := PAnsiChar(Config.RuleFars);
|
||||
C.BlankPenalty := Config.BlankPenalty;
|
||||
|
||||
C.Hr.DictDir := PAnsiChar(Config.Hr.DictDir);
|
||||
C.Hr.Lexicon := PAnsiChar(Config.Hr.Lexicon);
|
||||
C.Hr.RuleFsts := PAnsiChar(Config.Hr.RuleFsts);
|
||||
|
||||
Self.Handle := SherpaOnnxCreateOfflineRecognizer(@C);
|
||||
Self._Config := Config;
|
||||
end;
|
||||
|
||||
Reference in New Issue
Block a user