Upload custom_code/openbmb_MiniCPM4-8B.py with huggingface_hub
Browse files12345678910111213141516171819# /// script# requires-python = ">=3.12"# dependencies = [# "transformers",# "torch",# ]# ///
# Use a pipeline as a high-level helperfrom transformers import pipeline
pipe = pipeline("text-generation", model="openbmb/MiniCPM4-8B", trust_remote_code=True)messages = [ {"role": "user", "content": "Who are you?"},]pipe(messages)# Load model directlyfrom transformers import AutoModelForCausalLMmodel = AutoModelForCausalLM.from_pretrained("openbmb/MiniCPM4-8B", trust_remote_code=True)custom_code/openbmb_MiniCPM4-8B.pyAdded+19