model-metadata/code_python_files
013k
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 # No code snippets available yet for this library.24 25 # To use this model, check the repository files and the library's documentation.26 27 # Want to help? PRs adding snippets are welcome at:28 # https://github.com/huggingface/huggingface.js29 with open('salakash_Minimalism_0.txt', 'w', encoding='utf-8') as f:30 f.write('Everything was good in salakash_Minimalism_0.txt')31except Exception as e:32 import os33 from slack_sdk import WebClient34 client = WebClient(token=os.environ['SLACK_TOKEN'])35 client.chat_postMessage(36 channel='#hub-model-metadata-snippets-sprint',37 text='Problem in <https://huggingface.co/datasets/model-metadata/code_execution_files/blob/main/salakash_Minimalism_0.txt|salakash_Minimalism_0.txt>',38 )39 40 with open('salakash_Minimalism_0.txt', 'a', encoding='utf-8') as f:41 import traceback42 f.write('''```CODE: 43# No code snippets available yet for this library.44 45# To use this model, check the repository files and the library's documentation.46 47# Want to help? PRs adding snippets are welcome at:48# https://github.com/huggingface/huggingface.js49```50 51ERROR: 52''')53 traceback.print_exc(file=f)54 55finally:56 from huggingface_hub import upload_file57 upload_file(58 path_or_fileobj='salakash_Minimalism_0.txt',59 repo_id='model-metadata/code_execution_files',60 path_in_repo='salakash_Minimalism_0.txt',61 repo_type='dataset',62 )63 