Deploying sample Whisper Speech to Text model with LitServe
whisper_server.py
: Contains the WhisperLitAPI
that implements the LitAPI
interface.requirements.txt
: Contains the dependencies.whisper_server.py
file contains the WhisperLitAPI
class that implements the LitAPI
interface.
LitAPI
class and implement the setup
, decode_request
, predict
and encode_response
methods.
setup
: Load the model.decode_request
: Decodes and transforms the request body to the input format expected by the model.predict
: Processes the output of decode_request
and runs model inference.encode_response
: Formats the response. Can perform any postprocessing on the response.MODEL_DIR
environment variableWe are using an environment variable MODEL_DIR
to read the model path. This is useful when we want to load a model from a different path that can be downloaded and cached separately. See Cache Models and Artifacts guide for more details.Push the code to a Git repository or directly deploy from local machine
PythonBuild
Download Model from HuggingFace Hub in the deployment configuration
Artifacts Download
sectionView the deployment, logs and metrics