LightSeq Examples
November 9, 2022 ยท View on GitHub
Table of Contents
Cpp Examples
We provide multiple cpp examples of LightSeq inference.
First you should use the training examples in the following to train a model, and then export it to protobuf or HDF5 format.
Then use the cpp examples to infer the models:
- Uncomment the
add_subdirectory(examples/inference/cpp)in the CMakeLists.txt. - Build the LightSeq. Refer to build.md for more details.
- Switch to
build/temp.linux-xxx/examples/inference/cpp, and then runsudo maketo compile the cpp example. - Run the cpp examples by
./xxx_example MODEL_PATH.
Python Examples
We provide a series of Python examples to show how to use LightSeq to do model training and inference.
Train the models
Currently, LightSeq supports training from Fairseq, Hugging Face, DeepSpeed and from scratch. For more training details, please refer to the respective README.
Export and infer the models
First export the models training by Fairseq, Hugging Face or LightSeq to protobuf or HDF5 format. Then test the results and speeds using the testing scripts.
Refer to here for more details.
Deploy using Tritonbackend
Refer to here for more details.