Team Ai
Datasetpublic

model-metadata/custom_code_py_files

sourceHugging Faceupdated 1y agoView on Hugging Face
1likes9.5kdownloads
Skywork-R1V3-38B_0.py37 linesDownload Raw Back to root
1# /// script2# requires-python = ">=3.12"3# dependencies = [4#     "transformers",5#     "torch",6# ]7# ///8 9try:10    # Use a pipeline as a high-level helper11    from transformers import pipeline12    13    pipe = pipeline("image-text-to-text", model="Skywork/Skywork-R1V3-38B", trust_remote_code=True)14    messages = [15        {16            "role": "user",17            "content": [18                {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},19                {"type": "text", "text": "What animal is on the candy?"}20            ]21        },22    ]23    pipe(text=messages)24    with open('Skywork-R1V3-38B_0.txt', 'w') as f:25        f.write('Everything was good in Skywork-R1V3-38B_0')26except Exception as e:27    with open('Skywork-R1V3-38B_0.txt', 'w') as f:28        import traceback29        traceback.print_exc(file=f)30finally:31    from huggingface_hub import upload_file32    upload_file(33        path_or_fileobj='Skywork-R1V3-38B_0.txt',34        repo_id='model-metadata/custom_code_execution_files',35        path_in_repo='Skywork-R1V3-38B_0.txt',36        repo_type='dataset',37    )