Instructions to use pfnet/plamo-13b-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use pfnet/plamo-13b-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="pfnet/plamo-13b-instruct", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("pfnet/plamo-13b-instruct", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use pfnet/plamo-13b-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "pfnet/plamo-13b-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pfnet/plamo-13b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/pfnet/plamo-13b-instruct
- SGLang
How to use pfnet/plamo-13b-instruct with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "pfnet/plamo-13b-instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pfnet/plamo-13b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "pfnet/plamo-13b-instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pfnet/plamo-13b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use pfnet/plamo-13b-instruct with Docker Model Runner:
docker model run hf.co/pfnet/plamo-13b-instruct
Update README.md
Browse files17 unmodified lines1819202122232425262728293 unmodified lines3334353637383917 unmodified lines## UsageInstall the required libraries as follows:```bash>>> python -m pip install numpy safetensors sentencepiece torch transformers```Execute the following python code:```pythondef completion(prompt: str, max_new_tokens: int = 128) -> str:inputs = tokenizer(prompt, return_tensors="pt").to("cuda")generated_ids = model.generate(3 unmodified linesmax_new_tokens=max_new_tokens,temperature=1,top_p=0.95,do_sample=True,)return tokenizer.decode(generated_ids[0], skip_special_tokens=True, clean_up_tokenization_spaces=True)def generate_prompt(messages: list) -> str:17 unmodified lines181920212223242526272829303132333 unmodified lines373839404142434417 unmodified lines## UsageInstall the required libraries as follows:```sh>>> python -m pip install numpy safetensors sentencepiece torch transformers```Execute the following python code:```pythontokenizer = AutoTokenizer.from_pretrained("pfnet/plamo-13b-instruct", trust_remote_code=True)model = AutoModelForCausalLM.from_pretrained("pfnet/plamo-13b-instruct", trust_remote_code=True)def completion(prompt: str, max_new_tokens: int = 128) -> str:inputs = tokenizer(prompt, return_tensors="pt").to("cuda")generated_ids = model.generate(3 unmodified linesmax_new_tokens=max_new_tokens,temperature=1,top_p=0.95,do_sample=True,)return tokenizer.decode(generated_ids[0], skip_special_tokens=True, clean_up_tokenization_spaces=True)def generate_prompt(messages: list) -> str:
README.md+7-2