CoolFace
Datasetpublic

model-metadata/code_python_files

sourceHugging Faceupdated 7mo agoView on Hugging Face
0likes13kdownloads
microsoft_VibeVoice-ASR-HF_0.py61 linesDownload Raw Back to root
1# /// script2# requires-python = ">=3.12"3# dependencies = [4#     "numpy",5#     "einops",6#     "pandas",7#     "matplotlib",8#     "protobuf",9#     "torch",10#     "sentencepiece",11#     "torchvision",12#     "transformers",13#     "timm",14#     "diffusers",15#     "sentence-transformers",16#     "accelerate",17#     "peft",18#     "slack-sdk",19# ]20# ///21 22try:23    # Load model directly24    from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq25    26    processor = AutoProcessor.from_pretrained("microsoft/VibeVoice-ASR-HF")27    model = AutoModelForSpeechSeq2Seq.from_pretrained("microsoft/VibeVoice-ASR-HF")28    with open('microsoft_VibeVoice-ASR-HF_0.txt', 'w', encoding='utf-8') as f:29        f.write('Everything was good in microsoft_VibeVoice-ASR-HF_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/microsoft_VibeVoice-ASR-HF_0.txt|microsoft_VibeVoice-ASR-HF_0.txt>',37    )38 39    with open('microsoft_VibeVoice-ASR-HF_0.txt', 'a', encoding='utf-8') as f:40        import traceback41        f.write('''```CODE: 42# Load model directly43from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq44 45processor = AutoProcessor.from_pretrained("microsoft/VibeVoice-ASR-HF")46model = AutoModelForSpeechSeq2Seq.from_pretrained("microsoft/VibeVoice-ASR-HF")47```48 49ERROR: 50''')51        traceback.print_exc(file=f)52    53finally:54    from huggingface_hub import upload_file55    upload_file(56        path_or_fileobj='microsoft_VibeVoice-ASR-HF_0.txt',57        repo_id='model-metadata/code_execution_files',58        path_in_repo='microsoft_VibeVoice-ASR-HF_0.txt',59        repo_type='dataset',60    )61