model-metadata/custom-code-py-files
0355
1# /// script2# requires-python = ">=3.12"3# dependencies = [4# "transformers",5# "torch",6# ]7# ///8 9try:10 # Load model directly11 from transformers import AutoModelForCausalLM12 model = AutoModelForCausalLM.from_pretrained("tencent/Hunyuan-A13B-Instruct", trust_remote_code=True)13except Exception as e:14 exception_file = 'tencent_Hunyuan-A13B-Instruct_1_exception.txt'15 with open(exception_file, 'w') as f:16 import traceback17 traceback.print_exc(file=f)18 # Upload exception log to HuggingFace19 from huggingface_hub import upload_file20 upload_file(21 path_or_fileobj=exception_file,22 repo_id='model-metadata/model-code-exception',23 path_in_repo='09-07-25/tencent_Hunyuan-A13B-Instruct_1_exception.txt',24 repo_type='dataset',25 )