Giter Site home page Giter Site logo

Comments (4)

csukuangfj avatar csukuangfj commented on May 22, 2024

Could you help test the online or offline websocket server in sherpa-onnx and see if the second request is much faster than the very first request?


By the way, we have similar methods as k2-fsa/sherpa in sherpa-onnx

virtual std::vector<Ort::Value> GetEncoderInitStates() = 0;

virtual std::vector<Ort::Value> StackStates(
const std::vector<std::vector<Ort::Value>> &states) const = 0;

virtual std::vector<std::vector<Ort::Value>> UnStackStates(
const std::vector<Ort::Value> &states) const = 0;

It is not difficult to add warmup to sherpa-onnx if you find it is helpful to reduce the latency of the first request.


It may be tricky to save the model initial states during ONNX export I guess.

You don't need to save the initial states during model exporting. The initial state is constructed in the code in sherpa-onnx.
We only need some model parameters to construct the initial states.

from sherpa-onnx.

jingzhaoou avatar jingzhaoou commented on May 22, 2024

As I get better understanding of the code base, I realized that sherpa-onnx rewrites the Python initialization code in C++. The warm-up process is actually already in place. I am closing this PR.

from sherpa-onnx.

uni-sagar-raikar avatar uni-sagar-raikar commented on May 22, 2024

@csukuangfj @jingzhaoou Could you point me to code where model initialization is rewritten in C++. Didn't quite understand the point from previous comment. We see that, Warmup is still not part of the online websocket server.

from sherpa-onnx.

csukuangfj avatar csukuangfj commented on May 22, 2024

There is no warmup in sherpa-onnx, I think.

from sherpa-onnx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.