Browse Source

Fix some words

master^2
chenxujun 2 years ago
parent
commit
99507a5cc6
5 changed files with 7 additions and 7 deletions
  1. +2
    -2
      modelscope/fileio/file.py
  2. +2
    -2
      modelscope/hub/deploy.py
  3. +1
    -1
      modelscope/hub/file_download.py
  4. +2
    -2
      modelscope/metrics/image_denoise_metric.py
  5. +0
    -0
      tests/trainers/test_finetune_token_classification.py

+ 2
- 2
modelscope/fileio/file.py View File

@@ -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.




+ 2
- 2
modelscope/hub/deploy.py View File

@@ -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'


+ 1
- 1
modelscope/hub/file_download.py View File

@@ -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(


+ 2
- 2
modelscope/metrics/image_denoise_metric.py View File

@@ -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 '


tests/trainers/test_finetune_token_classificatin.py → tests/trainers/test_finetune_token_classification.py View File


Loading…
Cancel
Save