Team Ai
Datasetpublic

model-metadata/custom_code_py_files

sourceHugging Faceupdated 1y agoView on Hugging Face
1likes9.5kdownloads
DeepSeek-R1-0528_0.py31 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("text-generation", model="deepseek-ai/DeepSeek-R1-0528", trust_remote_code=True)14    messages = [15        {"role": "user", "content": "Who are you?"},16    ]17    pipe(messages)18    with open('DeepSeek-R1-0528_0.txt', 'w') as f:19        f.write('Everything was good in DeepSeek-R1-0528_0')20except Exception as e:21    with open('DeepSeek-R1-0528_0.txt', 'w') as f:22        import traceback23        traceback.print_exc(file=f)24finally:25    from huggingface_hub import upload_file26    upload_file(27        path_or_fileobj='DeepSeek-R1-0528_0.txt',28        repo_id='model-metadata/custom_code_execution_files',29        path_in_repo='DeepSeek-R1-0528_0.txt',30        repo_type='dataset',31    )