Text Generation
Transformers
PyTorch
Core ML
Safetensors
English
gpt2
text generation
causal-lm
Writer-data
NeMo
palmyra
text-generation-inference
Instructions to use Writer/palmyra-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Writer/palmyra-small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Writer/palmyra-small")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Writer/palmyra-small") model = AutoModelForCausalLM.from_pretrained("Writer/palmyra-small", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Writer/palmyra-small with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Writer/palmyra-small" # 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-small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Writer/palmyra-small
- SGLang
How to use Writer/palmyra-small 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-small" \ --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-small", "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-small" \ --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-small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Writer/palmyra-small with Docker Model Runner:
docker model run hf.co/Writer/palmyra-small
Update README.md
Browse files
README.md
CHANGED
|
@@ -70,35 +70,24 @@ Palmyra's core functionality is to take a string of text and predict the next to
|
|
| 70 |
|
| 71 |
Palmyra was trained on Writer custom data. As with all language models, it is difficult to predict how Palmyra will respond to specific prompts, and offensive content may appear unexpectedly. We recommend that the outputs be curated or filtered by humans before they are released, both to censor undesirable content and to improve the quality of the results.
|
| 72 |
|
| 73 |
-
##
|
|
|
|
| 74 |
|
| 75 |
-
|
| 76 |
|
| 77 |
|
| 78 |
-
| Task | Metric | Value |
|
| 79 |
-
|------------|--------|-------|
|
| 80 |
-
| boolq | acc | 64.43 |
|
| 81 |
-
| cb | acc | 10.71 |
|
| 82 |
-
| | f1 | 08.32 |
|
| 83 |
-
| copa | acc | 76.00 |
|
| 84 |
-
| multirc | acc | 01.26 |
|
| 85 |
-
| record | f1 | 84.02 |
|
| 86 |
-
| | em | 83.29 |
|
| 87 |
-
| wic | acc | 50.00 |
|
| 88 |
-
| wsc | acc | 36.54 |
|
| 89 |
-
|
| 90 |
|
| 91 |
## Citation and Related Information
|
| 92 |
|
| 93 |
|
| 94 |
To cite this model:
|
| 95 |
-
```
|
| 96 |
@misc{Palmyra,
|
| 97 |
-
author = {
|
| 98 |
-
title = {{
|
| 99 |
howpublished = {\url{https://github.com/kingoflolz/mesh-transformer-jax}},
|
| 100 |
-
year =
|
| 101 |
-
month =
|
| 102 |
}
|
| 103 |
```
|
| 104 |
|
|
|
|
| 70 |
|
| 71 |
Palmyra was trained on Writer custom data. As with all language models, it is difficult to predict how Palmyra will respond to specific prompts, and offensive content may appear unexpectedly. We recommend that the outputs be curated or filtered by humans before they are released, both to censor undesirable content and to improve the quality of the results.
|
| 72 |
|
| 73 |
+
## Use case
|
| 74 |
+
The fastest model and can perform tasks such as text parsing, address correction, and certain types of classification tasks that do not require a lot of nuance. More context can frequently improve Palmyra-small performance.
|
| 75 |
|
| 76 |
+
Good at: Text parsing, simple classification, and keyword recognition are all strengths.
|
| 77 |
|
| 78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
|
| 80 |
## Citation and Related Information
|
| 81 |
|
| 82 |
|
| 83 |
To cite this model:
|
| 84 |
+
```
|
| 85 |
@misc{Palmyra,
|
| 86 |
+
author = {Writer AI team},
|
| 87 |
+
title = {{Palmyra-small Parameter Autoregressive Language Model}},
|
| 88 |
howpublished = {\url{https://github.com/kingoflolz/mesh-transformer-jax}},
|
| 89 |
+
year = 2023,
|
| 90 |
+
month = January
|
| 91 |
}
|
| 92 |
```
|
| 93 |
|