CoolFace
Datasetpublic

model-metadata/code_python_files

sourceHugging Faceupdated 7mo agoView on Hugging Face
0likes13kdownloads
lightx2v_Autoencoders_0.py62 linesDownload Raw Back to root
1# /// script2# requires-python = ">=3.12"3# dependencies = [4#     "numpy",5#     "einops",6#     "pandas",7#     "protobuf",8#     "torch",9#     "sentencepiece",10#     "torchvision",11#     "transformers",12#     "timm",13#     "diffusers",14#     "sentence-transformers",15#     "accelerate",16#     "peft",17#     "slack-sdk",18# ]19# ///20 21try:22    from diffusers import DiffusionPipeline23    24    pipe = DiffusionPipeline.from_pretrained("lightx2v/Autoencoders")25    26    prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"27    image = pipe(prompt).images[0]28    with open('lightx2v_Autoencoders_0.txt', 'w', encoding='utf-8') as f:29        f.write('Everything was good in lightx2v_Autoencoders_0.txt')30except Exception as e:31    import os32    from slack_sdk import WebClient33    client = WebClient(token=os.environ['SLACK_TOKEN'])34    client.chat_postMessage(35        channel='#hub-model-metadata-snippets-sprint',36        text='Problem in <https://huggingface.co/datasets/model-metadata/code_execution_files/blob/main/lightx2v_Autoencoders_0.txt|lightx2v_Autoencoders_0.txt>',37    )38 39    with open('lightx2v_Autoencoders_0.txt', 'a', encoding='utf-8') as f:40        import traceback41        f.write('''```CODE: 42from diffusers import DiffusionPipeline43 44pipe = DiffusionPipeline.from_pretrained("lightx2v/Autoencoders")45 46prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"47image = pipe(prompt).images[0]48```49 50ERROR: 51''')52        traceback.print_exc(file=f)53    54finally:55    from huggingface_hub import upload_file56    upload_file(57        path_or_fileobj='lightx2v_Autoencoders_0.txt',58        repo_id='model-metadata/code_execution_files',59        path_in_repo='lightx2v_Autoencoders_0.txt',60        repo_type='dataset',61    )62