CoolFace
Datasetpublic

model-metadata/code_python_files

sourceHugging Faceupdated 7mo agoView on Hugging Face
0likes13kdownloads
utter-project_EuroLLM-9B_1.py58 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    # Use a pipeline as a high-level helper23    from transformers import pipeline24    25    pipe = pipeline("text-generation", model="utter-project/EuroLLM-9B")26    with open('utter-project_EuroLLM-9B_1.txt', 'w', encoding='utf-8') as f:27        f.write('Everything was good in utter-project_EuroLLM-9B_1.txt')28except Exception as e:29    import os30    from slack_sdk import WebClient31    client = WebClient(token=os.environ['SLACK_TOKEN'])32    client.chat_postMessage(33        channel='#hub-model-metadata-snippets-sprint',34        text='Problem in <https://huggingface.co/datasets/model-metadata/code_execution_files/blob/main/utter-project_EuroLLM-9B_1.txt|utter-project_EuroLLM-9B_1.txt>',35    )36 37    with open('utter-project_EuroLLM-9B_1.txt', 'a', encoding='utf-8') as f:38        import traceback39        f.write('''```CODE: 40# Use a pipeline as a high-level helper41from transformers import pipeline42 43pipe = pipeline("text-generation", model="utter-project/EuroLLM-9B")44```45 46ERROR: 47''')48        traceback.print_exc(file=f)49    50finally:51    from huggingface_hub import upload_file52    upload_file(53        path_or_fileobj='utter-project_EuroLLM-9B_1.txt',54        repo_id='model-metadata/code_execution_files',55        path_in_repo='utter-project_EuroLLM-9B_1.txt',56        repo_type='dataset',57    )58