model-metadata/custom_code_py_files
19.5k
1# /// script2# requires-python = ">=3.12"3# dependencies = [4# "numpy",5# "einops",6# "torch",7# "transformers",8# "datasets",9# "accelerate",10# "timm",11# ]12# ///13 14try:15 # Load model directly16 from transformers import AutoModel17 model = AutoModel.from_pretrained("PowerInfer/SmallThinker-21BA3B-Instruct", torch_dtype="auto"),18 with open('PowerInfer_SmallThinker-21BA3B-Instruct_1.txt', 'w') as f:19 f.write('Everything was good in PowerInfer_SmallThinker-21BA3B-Instruct_1.txt')20except Exception as e:21 with open('PowerInfer_SmallThinker-21BA3B-Instruct_1.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='PowerInfer_SmallThinker-21BA3B-Instruct_1.txt',28 repo_id='model-metadata/custom_code_execution_files',29 path_in_repo='PowerInfer_SmallThinker-21BA3B-Instruct_1.txt',30 repo_type='dataset',31 )