model-metadata/code_python_files
014k
1# /// script2# requires-python = ">=3.12"3# dependencies = [4# "torch",5# "torchvision",6# "transformers",7# "accelerate",8# "peft",9# "slack-sdk",10# ]11# ///12 13try:14 pip install -U diffusers transformers15 with open('lightx2v_Wan2.2-Distill-Loras_1.txt', 'w', encoding='utf-8') as f:16 f.write('Everything was good in lightx2v_Wan2.2-Distill-Loras_1.txt')17except Exception as e:18 import os19 from slack_sdk import WebClient20 client = WebClient(token=os.environ['SLACK_TOKEN'])21 client.chat_postMessage(22 channel='#exp-slack-alerts',23 text='Problem in <https://huggingface.co/datasets/model-metadata/code_execution_files/blob/main/lightx2v_Wan2.2-Distill-Loras_1.txt|lightx2v_Wan2.2-Distill-Loras_1.txt>',24 )25 26 with open('lightx2v_Wan2.2-Distill-Loras_1.txt', 'a', encoding='utf-8') as f:27 import traceback28 f.write('''```CODE: 29pip install -U diffusers transformers30```31 32ERROR: 33''')34 traceback.print_exc(file=f)35 36finally:37 from huggingface_hub import upload_file38 upload_file(39 path_or_fileobj='lightx2v_Wan2.2-Distill-Loras_1.txt',40 repo_id='model-metadata/code_execution_files',41 path_in_repo='lightx2v_Wan2.2-Distill-Loras_1.txt',42 repo_type='dataset',43 )44 