CoolFace
Datasetpublic

model-metadata/code_python_files

sourceHugging Faceupdated 7mo agoView on Hugging Face
0likes14kdownloads
krea_krea-realtime-video_2.py54 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    from diffusers import DiffusionPipeline15    16    pipe = DiffusionPipeline.from_pretrained("krea/krea-realtime-video")17    18    prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"19    image = pipe(prompt).images[0]20    with open('krea_krea-realtime-video_2.txt', 'w', encoding='utf-8') as f:21        f.write('Everything was good in krea_krea-realtime-video_2.txt')22except Exception as e:23    import os24    from slack_sdk import WebClient25    client = WebClient(token=os.environ['SLACK_TOKEN'])26    client.chat_postMessage(27        channel='#exp-slack-alerts',28        text='Problem in <https://huggingface.co/datasets/model-metadata/code_execution_files/blob/main/krea_krea-realtime-video_2.txt|krea_krea-realtime-video_2.txt>',29    )30 31    with open('krea_krea-realtime-video_2.txt', 'a', encoding='utf-8') as f:32        import traceback33        f.write('''```CODE: 34from diffusers import DiffusionPipeline35 36pipe = DiffusionPipeline.from_pretrained("krea/krea-realtime-video")37 38prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"39image = pipe(prompt).images[0]40```41 42ERROR: 43''')44        traceback.print_exc(file=f)45    46finally:47    from huggingface_hub import upload_file48    upload_file(49        path_or_fileobj='krea_krea-realtime-video_2.txt',50        repo_id='model-metadata/code_execution_files',51        path_in_repo='krea_krea-realtime-video_2.txt',52        repo_type='dataset',53    )54