Skip to content

Commit

Permalink
update limits of remove bg, and update the assert messages (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
doombeaker authored Jul 16, 2024
1 parent 7723f40 commit b95e10a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion supernode.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def remove_background(self, image):
device = image.device
_, w, h, _ = image.shape
assert (
w <= 1024 and h <= 1024
w <= 1536 and h <= 1536
), f"width and height must be less than 1024, but got {w} and {h}"

payload = {
Expand Down
4 changes: 3 additions & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ def format_bytes(num_bytes: int) -> str:


def validate_api_key(key: str):
assert isinstance(key, str), f"API_KEY must be a string, got {type(key)}"
assert isinstance(
key, str
), f"API_KEY must be a string, got {type(key)}. Please refer to https://cloud.siliconflow.cn to get your API_KEY"
assert key.startswith(
"sk"
), f"invalid key, please refer to https://cloud.siliconflow.cn to get your API_KEY, got {key}"
Expand Down

0 comments on commit b95e10a

Please sign in to comment.