Update benchmark_pipeline such that it can work for both v1 and v2 pipelines. v1 uses a different timer compared to v2 and the changes in this PR allow support for both. v2 also requires middleware to be passed to the pipeline constructor when creating it
Clean-up the middleware code. There are a lot of keys being passed around that were stored as strings. To have one source of truth, the middleware/timer files were updated to include the constants
Also, exposes the input_schema and output_schema at the pipeline level
Testing
The following both work for v1 and v2 when running the benchmark pipeline:
Summary
benchmark_pipeline
such that it can work for both v1 and v2 pipelines. v1 uses a different timer compared to v2 and the changes in this PR allow support for both. v2 also requiresmiddleware
to be passed to the pipeline constructor when creating itinput_schema
andoutput_schema
at the pipeline levelTesting
For text_generation:
Output:
For v1:
Output: