-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix potential issues with PyFuncBackend in cli (#9053)
Signed-off-by: Serena Ruan <serena.rxy@gmail.com>
- Loading branch information
1 parent
330bf0b
commit 6dde937
Showing
4 changed files
with
241 additions
and
19 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| """ | ||
| This script should be executed in a fresh python interpreter process using `subprocess`. | ||
| """ | ||
| import argparse | ||
|
|
||
| from mlflow.pyfunc.scoring_server import _predict | ||
|
|
||
|
|
||
| def parse_args(): | ||
| parser = argparse.ArgumentParser() | ||
| parser.add_argument("--model-uri", required=True) | ||
| parser.add_argument("--input-path", required=False) | ||
| parser.add_argument("--output-path", required=False) | ||
| parser.add_argument("--content-type", required=True) | ||
| return parser.parse_args() | ||
|
|
||
|
|
||
| def main(): | ||
| args = parse_args() | ||
| _predict( | ||
| model_uri=args.model_uri, | ||
| input_path=args.input_path if args.input_path else None, | ||
| output_path=args.output_path if args.output_path else None, | ||
| content_type=args.content_type, | ||
| ) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() |
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