clamsproject / clams-python

CLAMS SDK for python
http://sdk.clams.ai/
Apache License 2.0
4 stars 1 forks source link

implement wait-for-model/tool helper #168

Open keighrim opened 11 months ago

keighrim commented 11 months ago

Because

Because some wrapper CLAMS apps use fairly large models that take a few minutes to fully load in the memory, if an app user sends POST requests during that initiation time of underlying models/tools, the app would most likely behave badly. This already has happened in https://github.com/clamsproject/app-dbpedia-spotlight-wrapper/issues/3, and we'd like to make a SDK-level helper function to make sure apps don't "die" in such synchronous/asynchronous model initiation scenarios.

Done when

SDK has an implementation of

  1. external server timeout checker
  2. internal (in-memory) model readiness check
  3. and more...?

Additional context

This will be more of a problem soon, as vision-related apps are moving toward ViT-based models.