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
|
@@ -33,7 +33,7 @@ Palmyra was primarily pretrained with English text, there is still a trace amoun
|
|
| 33 |
|
| 34 |
## Training data
|
| 35 |
|
| 36 |
-
Palmyra-small 128M was trained on
|
| 37 |
|
| 38 |
## Intended Use and Limitations
|
| 39 |
|
|
@@ -66,60 +66,34 @@ tokenizer.batch_decode(generated_ids, skip_special_tokens=True)
|
|
| 66 |
|
| 67 |
### Limitations and Biases
|
| 68 |
|
| 69 |
-
|
| 70 |
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
As with all language models, it is hard to predict in advance how GPT-J will respond to particular prompts and offensive content may occur without warning. We recommend having a human curate or filter the outputs before releasing them, both to censor undesirable content and to improve the quality of the results.
|
| 74 |
|
| 75 |
## Evaluation results
|
| 76 |
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
|
| 80 |
-
|------------
|
| 81 |
-
|
|
| 82 |
-
|
|
| 83 |
-
|
|
| 84 |
-
|
|
| 85 |
-
|
|
| 86 |
-
|
|
| 87 |
-
|
|
| 88 |
-
|
|
| 89 |
-
|
|
| 90 |
-
|
| 91 |
-
| Megatron-11B† | ✓ | 1.0e22 | ----- | ----- | ----- | ----- | ----- | 161 |
|
| 92 |
-
| **GPT-J 6B‡** | **✓** | **1.5e22** | **3.99** | **69.7%** | **65.3%** | **66.1%** | **76.5%** | **825** |
|
| 93 |
-
| GPT-3 6.7B*‡ | ✗ | 1.2e22 | 4.00 | 70.3% | 64.5% | 67.4% | 78.0% | ~800 |
|
| 94 |
-
| GPT-3 Curie‡ | ✗ | ----- | 4.00 | 69.3% | 65.6% | 68.5% | 77.9% | ----- |
|
| 95 |
-
| GPT-3 13B*‡ | ✗ | 2.3e22 | 3.56 | 72.5% | 67.9% | 70.9% | 78.5% | ~800 |
|
| 96 |
-
| GPT-3 175B*‡ | ✗ | 3.1e23 | 3.00 | 76.2% | 70.2% | 78.9% | 81.0% | ~800 |
|
| 97 |
-
| GPT-3 Davinci‡ | ✗ | ----- | 3.0 | 75% | 72% | 78% | 80% | ----- |
|
| 98 |
-
<figcaption><p>Models roughly sorted by performance, or by FLOPs if not available.</p>
|
| 99 |
-
|
| 100 |
-
<p><strong>*</strong> Evaluation numbers reported by their respective authors. All other numbers are provided by
|
| 101 |
-
running <a href="https://github.com/EleutherAI/lm-evaluation-harness/"><code>lm-evaluation-harness</code></a> either with released
|
| 102 |
-
weights or with API access. Due to subtle implementation differences as well as different zero shot task framing, these
|
| 103 |
-
might not be directly comparable. See <a href="https://blog.eleuther.ai/gpt3-model-sizes/">this blog post</a> for more
|
| 104 |
-
details.</p>
|
| 105 |
-
|
| 106 |
-
<p><strong>†</strong> Megatron-11B provides no comparable metrics, and several implementations using the released weights do not
|
| 107 |
-
reproduce the generation quality and evaluations. (see <a href="https://github.com/huggingface/transformers/pull/10301">1</a>
|
| 108 |
-
<a href="https://github.com/pytorch/fairseq/issues/2358">2</a> <a href="https://github.com/pytorch/fairseq/issues/2719">3</a>)
|
| 109 |
-
Thus, evaluation was not attempted.</p>
|
| 110 |
-
|
| 111 |
-
<p><strong>‡</strong> These models have been trained with data which contains possible test set contamination. The OpenAI GPT-3 models
|
| 112 |
-
failed to deduplicate training data for certain test sets, while the GPT-Neo models as well as this one is
|
| 113 |
-
trained on the Pile, which has not been deduplicated against any test sets.</p></figcaption></figure>
|
| 114 |
|
| 115 |
## Citation and Related Information
|
| 116 |
|
| 117 |
-
### BibTeX entry
|
| 118 |
|
| 119 |
To cite this model:
|
| 120 |
```bibtex
|
| 121 |
-
@misc{
|
| 122 |
-
author = {
|
| 123 |
title = {{GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model}},
|
| 124 |
howpublished = {\url{https://github.com/kingoflolz/mesh-transformer-jax}},
|
| 125 |
year = 2021,
|
|
@@ -127,13 +101,3 @@ To cite this model:
|
|
| 127 |
}
|
| 128 |
```
|
| 129 |
|
| 130 |
-
To cite the codebase that trained this model:
|
| 131 |
-
```bibtex
|
| 132 |
-
@misc{mesh-transformer-jax,
|
| 133 |
-
author = {Wang, Ben},
|
| 134 |
-
title = {{Mesh-Transformer-JAX: Model-Parallel Implementation of Transformer Language Model with JAX}},
|
| 135 |
-
howpublished = {\url{https://github.com/kingoflolz/mesh-transformer-jax}},
|
| 136 |
-
year = 2021,
|
| 137 |
-
month = May
|
| 138 |
-
}
|
| 139 |
-
```
|
|
|
|
| 33 |
|
| 34 |
## Training data
|
| 35 |
|
| 36 |
+
Palmyra-small 128M was trained on Writer custom dataset
|
| 37 |
|
| 38 |
## Intended Use and Limitations
|
| 39 |
|
|
|
|
| 66 |
|
| 67 |
### Limitations and Biases
|
| 68 |
|
| 69 |
+
Palmyra's core functionality is to take a string of text and predict the next token. While language models are widely used for other tasks, there are many unknowns in this work. When prompting Palmyra, keep in mind that the statistically most likely next token is not always the token that produces the most "accurate" text. Never rely on Palmyra to produce factually correct results.
|
| 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 |
## Evaluation results
|
| 74 |
|
| 75 |
+
Evaluation of Palmyra-small model on the SuperGLUE benchmark
|
| 76 |
+
|------------|--------|-------|
|
| 77 |
+
| Task | Metric | Value |
|
| 78 |
+
|------------|--------|-------|
|
| 79 |
+
| boolq | acc | 64.43 |
|
| 80 |
+
| cb | acc | 10.71 |
|
| 81 |
+
| | f1 | 08.32 |
|
| 82 |
+
| copa | acc | 76.00 |
|
| 83 |
+
| multirc | acc | 01.26 |
|
| 84 |
+
| record | f1 | 84.02 |
|
| 85 |
+
| | em | 83.29 |
|
| 86 |
+
| wic | acc | 50.00 |
|
| 87 |
+
| wsc | acc | 36.54 |
|
| 88 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
|
| 90 |
## Citation and Related Information
|
| 91 |
|
|
|
|
| 92 |
|
| 93 |
To cite this model:
|
| 94 |
```bibtex
|
| 95 |
+
@misc{Palmyra,
|
| 96 |
+
author = {Kiran and Komatsuzaki, Aran},
|
| 97 |
title = {{GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model}},
|
| 98 |
howpublished = {\url{https://github.com/kingoflolz/mesh-transformer-jax}},
|
| 99 |
year = 2021,
|
|
|
|
| 101 |
}
|
| 102 |
```
|
| 103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|