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 # Use a pipeline as a high-level helper24 from transformers import pipeline25 26 pipe = pipeline("text-generation", model="PrimeIntellect/INTELLECT-3", trust_remote_code=True)27 messages = [28 {"role": "user", "content": "Who are you?"},29 ]30 pipe(messages)31 with open('PrimeIntellect_INTELLECT-3_0.txt', 'w', encoding='utf-8') as f:32 f.write('Everything was good in PrimeIntellect_INTELLECT-3_0.txt')33except Exception as e:34 import os35 from slack_sdk import WebClient36 client = WebClient(token=os.environ['SLACK_TOKEN'])37 client.chat_postMessage(38 channel='#hub-model-metadata-snippets-sprint',39 text='Problem in <https://huggingface.co/datasets/model-metadata/code_execution_files/blob/main/PrimeIntellect_INTELLECT-3_0.txt|PrimeIntellect_INTELLECT-3_0.txt>',40 )41 42 with open('PrimeIntellect_INTELLECT-3_0.txt', 'a', encoding='utf-8') as f:43 import traceback44 f.write('''```CODE: 45# Use a pipeline as a high-level helper46from transformers import pipeline47 48pipe = pipeline("text-generation", model="PrimeIntellect/INTELLECT-3", trust_remote_code=True)49messages = [50 {"role": "user", "content": "Who are you?"},51]52pipe(messages)53```54 55ERROR: 56''')57 traceback.print_exc(file=f)58 59finally:60 from huggingface_hub import upload_file61 upload_file(62 path_or_fileobj='PrimeIntellect_INTELLECT-3_0.txt',63 repo_id='model-metadata/code_execution_files',64 path_in_repo='PrimeIntellect_INTELLECT-3_0.txt',65 repo_type='dataset',66 )67 