mirror of
https://github.com/modelscope/modelscope.git
synced 2026-02-24 12:10:09 +01:00
fix pipeline builder
This commit is contained in:
@@ -28,7 +28,6 @@ def get_all_imported_modules():
|
||||
'Auto.*', 'T5.*', 'BitsAndBytesConfig', 'GenerationConfig', 'Awq.*',
|
||||
'GPTQ.*', 'BatchFeature', 'Qwen.*', 'Llama.*', 'PretrainedConfig',
|
||||
'PreTrainedTokenizer', 'PreTrainedModel', 'PreTrainedTokenizerFast',
|
||||
'Pipeline'
|
||||
]
|
||||
peft_include_names = ['.*PeftModel.*', '.*Config']
|
||||
diffusers_include_names = [
|
||||
|
||||
@@ -174,6 +174,18 @@ class LLMPipelineTest(unittest.TestCase):
|
||||
print('messages: ', pipe(self.messages_en, **self.gen_cfg))
|
||||
print('prompt: ', pipe(self.prompt_en, **self.gen_cfg))
|
||||
|
||||
@unittest.skipUnless(test_level() >= 1, 'skip test in current test level')
|
||||
def test_qwen2(self):
|
||||
pipe = pipeline(
|
||||
task='chat',
|
||||
model='qwen/Qwen2-0.5B-Instruct',
|
||||
model_revision='master',
|
||||
llm_first=True,
|
||||
torch_dtype='torch.float16',
|
||||
device_map='auto')
|
||||
print('messages: ', pipe(self.messages_en, **self.gen_cfg))
|
||||
print('prompt: ', pipe(self.prompt_en, **self.gen_cfg))
|
||||
|
||||
@unittest.skipUnless(test_level() >= 1, 'skip test in current test level')
|
||||
def test_llama2chat(self):
|
||||
pipe = pipeline(
|
||||
|
||||
Reference in New Issue
Block a user