model-metadata/code_python_files
014k
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 import os15 os.environ['HF_TOKEN'] = 'YOUR_TOKEN_HERE'16 with open('google_gemma-3-27b-it_3.txt', 'w', encoding='utf-8') as f:17 f.write('Everything was good in google_gemma-3-27b-it_3.txt')18except Exception as e:19 import os20 from slack_sdk import WebClient21 client = WebClient(token=os.environ['SLACK_TOKEN'])22 client.chat_postMessage(23 channel='#exp-slack-alerts',24 text='Problem in <https://huggingface.co/datasets/model-metadata/code_execution_files/blob/main/google_gemma-3-27b-it_3.txt|google_gemma-3-27b-it_3.txt>',25 )26 27 with open('google_gemma-3-27b-it_3.txt', 'a', encoding='utf-8') as f:28 import traceback29 f.write('''```CODE: 30import os31os.environ['HF_TOKEN'] = 'YOUR_TOKEN_HERE'32```33 34ERROR: 35''')36 traceback.print_exc(file=f)37 38finally:39 from huggingface_hub import upload_file40 upload_file(41 path_or_fileobj='google_gemma-3-27b-it_3.txt',42 repo_id='model-metadata/code_execution_files',43 path_in_repo='google_gemma-3-27b-it_3.txt',44 repo_type='dataset',45 )46 