-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Speechx] add nnet prob cache && make 2 thread decode work #2769
Conversation
This pull request is now in conflict :( |
const kaldi::Matrix<BaseFloat>& likelihood) { | ||
std::vector<BaseFloat> prob; | ||
prob.resize(likelihood.NumCols()); | ||
for (size_t idx = 0; idx < likelihood.NumRows(); ++idx) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
此处是否可以使用 memcpy相关函数 替换 两层 for循环;担心有效率问题
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不可以,Matrix内存非连续,不过后续会去掉kaldi::matrix这种,所以出现这种for的赋值了。
VLOG(2) << "Forward out " << nframes << " decoder frames."; | ||
std::vector<BaseFloat> logprob(vocab_dim); | ||
// remove later. | ||
for (size_t idx = 0; idx < nframes; ++idx) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
和上面类似的问题
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo remove later,feature 统一后,vector, Vector 等数据holder会统一处理。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include "recognizer/u2_recognizer.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
am 和 graph 双线程解码,例子可以初步这么写;最终还是需要在 recognizer 类上进行封装,比如 ASREngine,该类实例 在启动时 就启动了双线程
target_include_directories(${bin_name} PRIVATE ${pybind11_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}) | ||
target_link_libraries(${bin_name} ${PYTHON_LIBRARIES} ${PADDLE_LINK_FLAGS}) | ||
endif() | ||
#if(USING_U2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为什么注释掉了?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
api一些使用暂时还没有改完全,基本框架通了,只验证了recognizer_main, 等整体改完,在验证这几个_main.
@@ -130,11 +130,11 @@ class U2Recognizer { | |||
return !result_.empty() && !result_[0].sentence.empty(); | |||
} | |||
|
|||
|
|||
int FrameShiftInMs() const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这部分逻辑怎么处理?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
等完整后,再实现。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
现在基本框架是通的,很多细节没有修整。
PR types
Performance optimization
PR changes
Others
Describe
add nnet prob cache && make 2 thread decode work