CoolFace
Datasetpublic

model-metadata/code_python_files

sourceHugging Faceupdated 7mo agoView on Hugging Face
0likes13kdownloads
dx8152_Relight_1.py44 linesDownload Raw Back to root
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('dx8152_Relight_1.txt', 'w', encoding='utf-8') as f:16        f.write('Everything was good in dx8152_Relight_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/dx8152_Relight_1.txt|dx8152_Relight_1.txt>',24    )25 26    with open('dx8152_Relight_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='dx8152_Relight_1.txt',40        repo_id='model-metadata/code_execution_files',41        path_in_repo='dx8152_Relight_1.txt',42        repo_type='dataset',43    )44