Browse Source

[to #42322933]去除clip ut中的dev revision

Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/10507748

    * remove clip ut dev revision
master
yichang.zyc yingda.chen 3 years ago
parent
commit
35c612a642
1 changed files with 3 additions and 8 deletions
  1. +3
    -8
      tests/pipelines/test_multi_modal_embedding.py

+ 3
- 8
tests/pipelines/test_multi_modal_embedding.py View File

@@ -19,14 +19,11 @@ class MultiModalEmbeddingTest(unittest.TestCase, DemoCompatibilityCheck):
self.model_id = 'damo/multi-modal_clip-vit-base-patch16_zh' self.model_id = 'damo/multi-modal_clip-vit-base-patch16_zh'


test_input = {'text': '皮卡丘'} test_input = {'text': '皮卡丘'}
model_version = 'dev'


@unittest.skipUnless(test_level() >= 0, 'skip test in current test level') @unittest.skipUnless(test_level() >= 0, 'skip test in current test level')
def test_run(self): def test_run(self):
pipeline_multi_modal_embedding = pipeline( pipeline_multi_modal_embedding = pipeline(
Tasks.multi_modal_embedding,
model=self.model_id,
model_revision=self.model_version)
Tasks.multi_modal_embedding, model=self.model_id)
text_embedding = pipeline_multi_modal_embedding( text_embedding = pipeline_multi_modal_embedding(
self.test_input)[OutputKeys.TEXT_EMBEDDING] self.test_input)[OutputKeys.TEXT_EMBEDDING]
print('l1-norm: {}'.format( print('l1-norm: {}'.format(
@@ -36,8 +33,7 @@ class MultiModalEmbeddingTest(unittest.TestCase, DemoCompatibilityCheck):


@unittest.skipUnless(test_level() >= 1, 'skip test in current test level') @unittest.skipUnless(test_level() >= 1, 'skip test in current test level')
def test_run_with_model_from_modelhub(self): def test_run_with_model_from_modelhub(self):
model = Model.from_pretrained(
self.model_id, revision=self.model_version)
model = Model.from_pretrained(self.model_id)
pipeline_multi_modal_embedding = pipeline( pipeline_multi_modal_embedding = pipeline(
task=Tasks.multi_modal_embedding, model=model) task=Tasks.multi_modal_embedding, model=model)
text_embedding = pipeline_multi_modal_embedding( text_embedding = pipeline_multi_modal_embedding(
@@ -50,8 +46,7 @@ class MultiModalEmbeddingTest(unittest.TestCase, DemoCompatibilityCheck):
@unittest.skipUnless(test_level() >= 1, 'skip test in current test level') @unittest.skipUnless(test_level() >= 1, 'skip test in current test level')
def test_run_with_default_model(self): def test_run_with_default_model(self):
pipeline_multi_modal_embedding = pipeline( pipeline_multi_modal_embedding = pipeline(
task=Tasks.multi_modal_embedding,
model_revision=self.model_version)
task=Tasks.multi_modal_embedding)
text_embedding = pipeline_multi_modal_embedding( text_embedding = pipeline_multi_modal_embedding(
self.test_input)[OutputKeys.TEXT_EMBEDDING] self.test_input)[OutputKeys.TEXT_EMBEDDING]
print('l1-norm: {}'.format( print('l1-norm: {}'.format(


Loading…
Cancel
Save