CoolFace
Datasetpublic

model-metadata/custom-code-py-files

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes838downloads
DeepSeek-R127 linesDownload Raw Back to root
1# /// script2# requires-python = ">=3.12"3# dependencies = [4#     "transformers",5#     "torch",6# ]7# ///8 9try:10    # Load model directly11    from transformers import AutoTokenizer, AutoModelForCausalLM12    13    tokenizer = AutoTokenizer.from_pretrained("deepseek-ai/DeepSeek-R1", trust_remote_code=True)14    model = AutoModelForCausalLM.from_pretrained("deepseek-ai/DeepSeek-R1", trust_remote_code=True)15except Exception as e:16    exception_file = 'deepseek-ai_DeepSeek-R1_1_exception.txt'17    with open(exception_file, 'w') as f:18        import traceback19        traceback.print_exc(file=f)20    # Upload exception log to HuggingFace21    from huggingface_hub import upload_file22    upload_file(23        path_or_fileobj=exception_file,24        repo_id='model-metadata/model-code-exception',25        path_in_repo='09-07-25/deepseek-ai_DeepSeek-R1_1_exception.txt',26        repo_type='dataset',27    )