Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
SamitHuang committed Aug 24, 2024
1 parent 1f5aba1 commit 9ecc6d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion examples/opensora_hpcai/opensora/models/vae/lpips.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
import mindspore as ms
import mindspore.nn as nn
import mindspore.ops as ops
from mindone.utils.params import load_from_pretrained

from mindone.utils.params import load_from_pretrained

_logger = logging.getLogger(__name__)


class LPIPS(nn.Cell):
# Learned perceptual metric
def __init__(self, use_dropout=True):
Expand Down
9 changes: 5 additions & 4 deletions mindone/utils/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@
import re
from typing import List, Optional, Union

from mindcv.utils.download import Download

import mindspore as ms
import mindspore.nn as nn
from mindspore import Parameter
from mindspore import log as logger

# from mindspore._checkparam import Validator
from mindspore.train.serialization import _load_dismatch_prefix_params, _update_param
from mindcv.utils.download import Download


def is_url(string):
# Regex to check for URL patterns
url_pattern = re.compile(r'^(http|https|ftp)://')
url_pattern = re.compile(r"^(http|https|ftp)://")
return bool(url_pattern.match(string))


Expand Down Expand Up @@ -111,9 +112,9 @@ def load_from_pretrained(
checkpoint: Union[str, dict],
ignore_net_params_not_loaded=False,
ensure_all_ckpt_params_loaded=False,
cache_dir: str=None,
cache_dir: str = None,
):
""" load checkpoint into network.
"""load checkpoint into network.
Args:
net: network
Expand Down

0 comments on commit 9ecc6d7

Please sign in to comment.