CoolFace
Datasetpublic

model-metadata/code_python_files

sourceHugging Faceupdated 7mo agoView on Hugging Face
0likes14kdownloads
openai_gpt-oss-20b_2.py46 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    import os15    os.environ['HF_TOKEN'] = 'YOUR_TOKEN_HERE'16    with open('openai_gpt-oss-20b_2.txt', 'w', encoding='utf-8') as f:17        f.write('Everything was good in openai_gpt-oss-20b_2.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/openai_gpt-oss-20b_2.txt|openai_gpt-oss-20b_2.txt>',25    )26 27    with open('openai_gpt-oss-20b_2.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='openai_gpt-oss-20b_2.txt',42        repo_id='model-metadata/code_execution_files',43        path_in_repo='openai_gpt-oss-20b_2.txt',44        repo_type='dataset',45    )46