import os

os.environ['CUDA_VISIBLE_DEVICES'] = '0'
os.environ['ASCEND_RT_VISIBLE_DEVICES'] = '0'
os.environ['SWIFT_DEBUG'] = '1'


def test_deepseek_janus_pro_gene():
    from swift import InferArguments, infer_main
    args = InferArguments(model='deepseek-ai/Janus-Pro-1B', infer_backend='transformers')
    infer_main(args)


def test_emu3_gen(infer_backend):
    from swift import InferArguments, infer_main
    args = InferArguments(
        model='BAAI/Emu3-Gen',
        infer_backend=infer_backend,
        stream=False,
        use_chat_template=False,
        top_k=2048,
        max_new_tokens=40960)
    infer_main(args)


if __name__ == '__main__':
    # test_emu3_gen('transformers')
    test_deepseek_janus_pro_gene()
