Skip to content

Commit

Permalink
fix(api): rename to avoid shadowing type
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Jan 11, 2023
1 parent 07fa81a commit 48f42e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/onnx_web/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ def json_with_cors(data, origin='*'):
return res


def make_output_path(type: str, seed: int, params: Tuple[Union[str, int, float]]):
def make_output_path(mode: str, seed: int, params: Tuple[Union[str, int, float]]):
sha = sha256()
sha.update(type.encode('utf-8'))
sha.update(mode.encode('utf-8'))
for param in params:
if isinstance(param, str):
sha.update(param.encode('utf-8'))
Expand All @@ -161,7 +161,7 @@ def make_output_path(type: str, seed: int, params: Tuple[Union[str, int, float]]
else:
print('cannot hash param: %s, %s' % (param, type(param)))

output_file = '%s_%s_%s.png' % (type, seed, sha.hexdigest())
output_file = '%s_%s_%s.png' % (mode, seed, sha.hexdigest())
output_full = safer_join(output_path, output_file)

return (output_file, output_full)
Expand Down
1 change: 1 addition & 0 deletions onnx-web.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"numpy",
"Onnx",
"onnxruntime",
"outpaint",
"pndm",
"pretrained",
"protobuf",
Expand Down

0 comments on commit 48f42e5

Please sign in to comment.