Upload phi-3-M3-coder with huggingface_hub
Browse files6 unmodified lines7891011101112131415161713141519161718192 unmodified lines222324282526276 unmodified lines# ///
try: # Use a pipeline as a high-level helper from transformers import pipeline # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM pipe = pipeline("text-generation", model="moelanoby/phi-3-M3-coder", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages) tokenizer = 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_0_exception.txt' exception_file = 'moelanoby_phi-3-M3-coder_1_exception.txt' with open(exception_file, 'w') as f: import traceback traceback.print_exc(file=f)2 unmodified lines upload_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', path_in_repo='09-07-25/moelanoby_phi-3-M3-coder_1_exception.txt', repo_type='dataset', )phi-3-M3-coder+6-9