Upload phi-3-M3-coder with huggingface_hub
Browse files6 unmodified lines789101112131415161718192021222 unmodified lines2526272829306 unmodified lines# ///try:# Use a pipeline as a high-level helperfrom transformers import pipelinepipe = pipeline("text-generation", model="moelanoby/phi-3-M3-coder", trust_remote_code=True)messages = [{"role": "user", "content": "Who are you?"},]pipe(messages)except Exception as e:exception_file = 'moelanoby_phi-3-M3-coder_0_exception.txt'with open(exception_file, 'w') as f:import tracebacktraceback.print_exc(file=f)2 unmodified linesupload_file(path_or_fileobj=exception_file,repo_id='model-metadata/model-code-exception',path_in_repo='09-07-25/moelanoby_phi-3-M3-coder_0_exception.txt',repo_type='dataset',)6 unmodified lines789101112131415161718192 unmodified lines2223242526276 unmodified lines# ///try:# Load model directlyfrom transformers import AutoTokenizer, AutoModelForCausalLMtokenizer = AutoTokenizer.from_pretrained("moelanoby/phi-3-M3-coder", trust_remote_code=True)model = AutoModelForCausalLM.from_pretrained("moelanoby/phi-3-M3-coder", trust_remote_code=True)except Exception as e:exception_file = 'moelanoby_phi-3-M3-coder_1_exception.txt'with open(exception_file, 'w') as f:import tracebacktraceback.print_exc(file=f)2 unmodified linesupload_file(path_or_fileobj=exception_file,repo_id='model-metadata/model-code-exception',path_in_repo='09-07-25/moelanoby_phi-3-M3-coder_1_exception.txt',repo_type='dataset',)
phi-3-M3-coder+6-9