Closed rikrd closed 9 years ago
Your comment says that word_syms also gets loaded as soon as it set, but the PR does now seem to do that. Is there a reason?
Also, in gst_kaldinnet2onlinedecoder_load_model()
, the old model (if already set) is not freed.
I have added the loading of the word_syms.
The old model, does not get freed because if I understand correctly, the Kaldi object can be reused to load the new model.
The only shortcoming of this is that we don't control the state of the object after trying to load the new model we trust Kaldi will leave it as it previously was.
Oh I see, you are of course correct about freeing.
@rikrd I was trying to change the fst dynamically with kaldi-gstreamer-server. decoder2.py:
self.asr.set_state(Gst.State.PAUSED)
self.asr.set_property('fst', 'path/HCLG.fst')
self.asr.set_state(Gst.State.PLAYING)
which causes a fault. Any ideas about that? (I tried the model too and it's working as expected)
This pull requests attempts to resolve issue #4 Allow switching models and graphs, with simple property changes.
Set the default model, fst, word_syms to empty strings, since all these Kaldi objects get loaded as soon as they are set not in the allocate stage.