model-metadata/custom_code_py_files
19.5k
1# /// script2# requires-python = ">=3.12"3# dependencies = [4# "transformers",5# "torch",6# ]7# ///8 9try:10 # Load model directly11 from transformers import AutoModel12 model = AutoModel.from_pretrained("OpenGVLab/InternVL3_5-4B", trust_remote_code=True, torch_dtype="auto")13 with open('OpenGVLab_InternVL3_5-4B_1.txt', 'w') as f:14 f.write('Everything was good in OpenGVLab_InternVL3_5-4B_1.txt')15except Exception as e:16 with open('OpenGVLab_InternVL3_5-4B_1.txt', 'w') as f:17 import traceback18 traceback.print_exc(file=f)19finally:20 from huggingface_hub import upload_file21 upload_file(22 path_or_fileobj='OpenGVLab_InternVL3_5-4B_1.txt',23 repo_id='model-metadata/custom_code_execution_files',24 path_in_repo='OpenGVLab_InternVL3_5-4B_1.txt',25 repo_type='dataset',26 )