@@ -138,7 +138,7 @@ class HTTPStorage(Storage): | |||||
self, filepath: str) -> Generator[Union[str, Path], None, None]: | self, filepath: str) -> Generator[Union[str, Path], None, None]: | ||||
"""Download a file from ``filepath``. | """Download a file from ``filepath``. | ||||
``as_local_path`` is decorated by :meth:`contxtlib.contextmanager`. It | |||||
``as_local_path`` is decorated by :meth:`contextlib.contextmanager`. It | |||||
can be called with ``with`` statement, and when exists from the | can be called with ``with`` statement, and when exists from the | ||||
``with`` statement, the temporary path will be released. | ``with`` statement, the temporary path will be released. | ||||
@@ -192,7 +192,7 @@ class OSSStorage(Storage): | |||||
self, filepath: str) -> Generator[Union[str, Path], None, None]: | self, filepath: str) -> Generator[Union[str, Path], None, None]: | ||||
"""Download a file from ``filepath``. | """Download a file from ``filepath``. | ||||
``as_local_path`` is decorated by :meth:`contxtlib.contextmanager`. It | |||||
``as_local_path`` is decorated by :meth:`contextlib.contextmanager`. It | |||||
can be called with ``with`` statement, and when exists from the | can be called with ``with`` statement, and when exists from the | ||||
``with`` statement, the temporary path will be released. | ``with`` statement, the temporary path will be released. | ||||
@@ -36,7 +36,7 @@ class EASRegion(object): | |||||
class EASCpuInstanceType(object): | class EASCpuInstanceType(object): | ||||
"""EAS Cpu Instance TYpe, ref(https://help.aliyun.com/document_detail/144261.html) | |||||
"""EAS Cpu Instance Type, ref(https://help.aliyun.com/document_detail/144261.html) | |||||
""" | """ | ||||
tiny = 'ecs.c6.2xlarge' | tiny = 'ecs.c6.2xlarge' | ||||
small = 'ecs.c6.4xlarge' | small = 'ecs.c6.4xlarge' | ||||
@@ -45,7 +45,7 @@ class EASCpuInstanceType(object): | |||||
class EASGpuInstanceType(object): | class EASGpuInstanceType(object): | ||||
"""EAS Cpu Instance TYpe, ref(https://help.aliyun.com/document_detail/144261.html) | |||||
"""EAS Gpu Instance Type, ref(https://help.aliyun.com/document_detail/144261.html) | |||||
""" | """ | ||||
tiny = 'ecs.gn5-c28g1.7xlarge' | tiny = 'ecs.gn5-c28g1.7xlarge' | ||||
small = 'ecs.gn5-c8g1.4xlarge' | small = 'ecs.gn5-c8g1.4xlarge' | ||||
@@ -165,7 +165,7 @@ def get_file_download_url(model_id: str, file_path: str, revision: str): | |||||
""" | """ | ||||
Format file download url according to `model_id`, `revision` and `file_path`. | Format file download url according to `model_id`, `revision` and `file_path`. | ||||
e.g., Given `model_id=john/bert`, `revision=master`, `file_path=README.md`, | e.g., Given `model_id=john/bert`, `revision=master`, `file_path=README.md`, | ||||
the resulted download url is: https://modelscope.co/api/v1/models/john/bert/repo?Revision=master&FilePath=README.md | |||||
the resulted download url is: https://modelscope.cn/api/v1/models/john/bert/repo?Revision=master&FilePath=README.md | |||||
""" | """ | ||||
download_url_template = '{endpoint}/api/v1/models/{model_id}/repo?Revision={revision}&FilePath={file_path}' | download_url_template = '{endpoint}/api/v1/models/{model_id}/repo?Revision={revision}&FilePath={file_path}' | ||||
return download_url_template.format( | return download_url_template.format( | ||||
@@ -86,7 +86,7 @@ def calculate_psnr(img1, img2, crop_border, input_order='HWC'): | |||||
""" | """ | ||||
assert img1.shape == img2.shape, ( | assert img1.shape == img2.shape, ( | ||||
f'Image shapes are differnet: {img1.shape}, {img2.shape}.') | |||||
f'Image shapes are different: {img1.shape}, {img2.shape}.') | |||||
if input_order not in ['HWC', 'CHW']: | if input_order not in ['HWC', 'CHW']: | ||||
raise ValueError( | raise ValueError( | ||||
f'Wrong input_order {input_order}. Supported input_orders are ' | f'Wrong input_order {input_order}. Supported input_orders are ' | ||||
@@ -141,7 +141,7 @@ def calculate_ssim(img1, img2, crop_border, input_order='HWC', ssim3d=True): | |||||
""" | """ | ||||
assert img1.shape == img2.shape, ( | assert img1.shape == img2.shape, ( | ||||
f'Image shapes are differnet: {img1.shape}, {img2.shape}.') | |||||
f'Image shapes are different: {img1.shape}, {img2.shape}.') | |||||
if input_order not in ['HWC', 'CHW']: | if input_order not in ['HWC', 'CHW']: | ||||
raise ValueError( | raise ValueError( | ||||
f'Wrong input_order {input_order}. Supported input_orders are ' | f'Wrong input_order {input_order}. Supported input_orders are ' | ||||