Instructions to use Writer/palmyra-med-20b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Writer/palmyra-med-20b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Writer/palmyra-med-20b")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Writer/palmyra-med-20b") model = AutoModelForCausalLM.from_pretrained("Writer/palmyra-med-20b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Writer/palmyra-med-20b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Writer/palmyra-med-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/palmyra-med-20b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Writer/palmyra-med-20b
- SGLang
How to use Writer/palmyra-med-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/palmyra-med-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/palmyra-med-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/palmyra-med-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/palmyra-med-20b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Writer/palmyra-med-20b with Docker Model Runner:
docker model run hf.co/Writer/palmyra-med-20b
Commit History
-
Update README.md
Verified signaturea9ba352
-
Adding Evaluation Results (#5)
- Adding Evaluation Results (d51cb0405256ff61b3f51a445484a5d3c5a2dc4d) Co-authored-by: Open LLM Leaderboard PR Bot <leaderboard-pr-bot@users.noreply.huggingface.co>11a7a28
-
Model card has typo (#7)
- Model card has typo (994b152901da01342b7cea413d5b859ecf882915) Co-authored-by: Kim Joon Hong <danielkim@users.noreply.huggingface.co>f517097
-
Update README.md (#3)
- Update README.md (d09d17ce28fc97dfc2df94311057278946fc60a5)407810f
-
Update README.md
6b4ae90 -
add example for text-generation-inference (#1)
- add example for text-generation-inference (ba805d8df11c196a4337ae3ea55356db28bd5fda) Co-authored-by: Nicholas Broad <nbroad@users.noreply.huggingface.co>7a998c6 -
Update README.md
5553ff5 -
Update README.md
3cd806c -
Update README.md
8245c1a
-
Update README.md
9b9cebe -
Update README.md
7088235 -
Update README.md
482ac71
-
Create README.md
def23fe -
Update config.json
74bebd0 -
Upload tokenizer
ef5b0a6 -
Upload model
147712f -
Upload tokenizer
57e4f80 -
Upload tokenizer
2e7c6a2
-
initial commit
55606b1