Instructions to use Writer/InstructPalmyra-20b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Writer/InstructPalmyra-20b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Writer/InstructPalmyra-20b")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Writer/InstructPalmyra-20b") model = AutoModelForCausalLM.from_pretrained("Writer/InstructPalmyra-20b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Writer/InstructPalmyra-20b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Writer/InstructPalmyra-20b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Writer/InstructPalmyra-20b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Writer/InstructPalmyra-20b
- SGLang
How to use Writer/InstructPalmyra-20b 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 "Writer/InstructPalmyra-20b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Writer/InstructPalmyra-20b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Writer/InstructPalmyra-20b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Writer/InstructPalmyra-20b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Writer/InstructPalmyra-20b with Docker Model Runner:
docker model run hf.co/Writer/InstructPalmyra-20b
Commit History
-
Update handler.py
d2f3e5e -
Update handler.py
da419fa -
Create handler.py (#4)
- Create handler.py (da1ea7155eb354e4c417ab1270e5e154ad34bb24)eae6b01
-
Update README.md
99129c0
-
Update README.md
c78df44 -
add example for text-generation-inference (#3)
- add example for text-generation-inference (75567ca2bc15f3012f7380032ed1229345223c5e) Co-authored-by: Nicholas Broad <nbroad@users.noreply.huggingface.co>22c5896 -
changed palmyra-med -> InstructPalmyra-20b (#2)
- changed palmyra-med -> InstructPalmyra-20b (629a8d3a8d0b8271d8f4213b37ae7884250fb95e) Co-authored-by: Nicholas Broad <nbroad@users.noreply.huggingface.co>f4592e8 -
Update README.md
f91439a
-
Delete pytorch_model-00001-of-00009.bin
af3875b -
Delete pytorch_model-00002-of-00009.bin
6f285b9 -
Delete pytorch_model-00003-of-00009.bin
210a666 -
Delete pytorch_model-00004-of-00009.bin
7d010bb -
Delete pytorch_model-00005-of-00009.bin
b103c3c -
Delete pytorch_model-00006-of-00009.bin
6156ee1 -
Delete pytorch_model-00007-of-00009.bin
8348215 -
Delete pytorch_model-00008-of-00009.bin
6c9eeaf -
Delete pytorch_model-00009-of-00009.bin
ffc002d -
Upload tokenizer
59a787e -
Upload model
581dcae
-
Create README.md
68380df
-
add model files
4050e6f -
initial commit
2eb0a52