Skip to content

Commit

Permalink
update schemas for archive converter
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Dec 17, 2023
1 parent 72d0d37 commit a65e0fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions api/onnx_web/convert/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def convert_extract_archive(

if path.exists(dest_path):
logger.info("destination path already exists, skipping extraction")
return False, dest_path

cache_path = fetch_model(conversion, name, model["source"], format=format)

Expand All @@ -33,6 +34,7 @@ def convert_extract_archive(

logger.debug("archive is valid, extracting all files: %s", names)
zip.extractall(path=dest_path)
return True, dest_path


SAFE_NAME = r"^[-_a-zA-Z/\\\.]+$"
Expand Down
3 changes: 2 additions & 1 deletion api/schemas/extras.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $defs:

tensor_format:
type: string
enum: [bin, ckpt, onnx, pt, pth, safetensors]
enum: [bin, ckpt, onnx, pt, pth, safetensors, zip]

embedding_network:
type: object
Expand Down Expand Up @@ -111,6 +111,7 @@ $defs:
pipeline:
type: string
enum: [
archive,
controlnet,
img2img,
inpaint,
Expand Down

0 comments on commit a65e0fd

Please sign in to comment.