Skip to content

Commit

Permalink
fix(api): correctly handle missing inversion param
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Feb 25, 2023
1 parent 973b0a9 commit 3626d69
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/onnx_web/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def __init__(
lpw: bool = False,
eta: float = 0.0,
batch: int = 1,
inversion: str = None,
inversion: Optional[str] = None,
) -> None:
self.model = model
self.scheduler = scheduler
Expand Down
7 changes: 5 additions & 2 deletions api/onnx_web/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,11 @@ def pipeline_from_request() -> Tuple[DeviceParams, ImageParams, Size]:
scheduler = get_from_map(
request.args, "scheduler", pipeline_schedulers, get_config_value("scheduler")
)
inversion = get_not_empty(request.args, "inversion", get_config_value("inversion"))
inversion_path = get_model_path(inversion)

inversion = request.args.get("inversion", None)
inversion_path = None
if inversion is not None and inversion.strip() != "":
inversion_path = get_model_path(inversion)

# image params
prompt = get_not_empty(request.args, "prompt", get_config_value("prompt"))
Expand Down
6 changes: 6 additions & 0 deletions common/scripts/copy-pr-to-gitlab.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PR_USER=$1
PR_BRANCH=$2

git remote add $1 git@github.com:$1/onnx-web.git
git fetch $1
git push gitlab refs/remotes/$1/$2:refs/heads/$1-$2

0 comments on commit 3626d69

Please sign in to comment.