-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add infer() function for end to end inference pipeline (#952)
* Inference and Functions Signed-off-by: elronbandel <elron.bandel@ibm.com> * Update Signed-off-by: elronbandel <elron.bandel@ibm.com> * delete function from PR Signed-off-by: elronbandel <elron.bandel@ibm.com> * Update docs Signed-off-by: elronbandel <elron.bandel@ibm.com> * Update Signed-off-by: elronbandel <elron.bandel@ibm.com> * Update docs Signed-off-by: elronbandel <elron.bandel@ibm.com> * FIx Signed-off-by: elronbandel <elron.bandel@ibm.com> --------- Signed-off-by: elronbandel <elron.bandel@ibm.com>
- Loading branch information
1 parent
029afd1
commit 1cef107
Showing
8 changed files
with
181 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from unitxt.catalog import add_to_catalog | ||
from unitxt.inference import HFPipelineBasedInferenceEngine | ||
|
||
engine = HFPipelineBasedInferenceEngine( | ||
model_name="google/flan-t5-small", max_new_tokens=32 | ||
) | ||
|
||
add_to_catalog(engine, "engines.model.flan.t5_small.hf", overwrite=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"__type__": "hf_pipeline_based_inference_engine", | ||
"model_name": "google/flan-t5-small", | ||
"max_new_tokens": 32 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters