|
--- |
|
language: |
|
- en |
|
datasets: |
|
- English |
|
tags: |
|
- text generation |
|
- pytorch |
|
- causal-lm |
|
- Writer-data |
|
pipeline_tag: text-generation |
|
library_name: transformers |
|
--- |
|
|
|
license: cc-by-4.0 |
|
|
|
|
|
# Palmyra-small |
|
|
|
<style> |
|
img { |
|
display: inline; |
|
} |
|
</style> |
|
|
|
|[![Model architecture](https://img.shields.io/badge/Model%20Arch-Transformer%20Decoder-green)](#model-architecture)|[![Model size](https://img.shields.io/badge/Params-126M-green)](#model-architecture)|[![Language](https://img.shields.io/badge/Language-en--US-lightgrey#model-badge)](#datasets) |
|
|
|
|
|
## Model Description |
|
|
|
Palmyra was primarily pretrained with English text, there is still a trace amount of non-English data present within the training corpus that was accessed through CommonCrawl. A causal language modeling (CLM) objective was utilized during the process of the model's pretraining. Similar to GPT-3, Palmyra is a member of the same family of models that only contain a decoder. As a result, it was pretrained utilizing the objective of self-supervised causal language modeling. Palmyra uses the prompts and general experimental setup from GPT-3 in order to conduct its evaluation in accordance with GPT-3. Read the official paper if you want more information about this. |
|
|
|
|
|
## Training data |
|
|
|
Palmyra-small 128M was trained on Writer custom dataset |
|
|
|
## Intended Use and Limitations |
|
|
|
Palmyra-small learns an inner representation of the English language that can be used to extract features useful for downstream tasks. The model is best at what it was pretrained for however, which is generating text from a prompt. |
|
|
|
### How to use |
|
|
|
This model can be easily loaded using the `AutoModelForCausalLM` functionality: |
|
|
|
```python |
|
|
|
from transformers import AutoModelForCausalLM, AutoTokenizer |
|
import torch |
|
|
|
model = AutoModelForCausalLM.from_pretrained("Writer/palmyra-small", torch_dtype=torch.float16).cuda() |
|
|
|
# the fast tokenizer currently does not work correctly |
|
tokenizer = AutoTokenizer.from_pretrained("Writer/palmyra-small", use_fast=False) |
|
|
|
prompt = "What is the color of a carrot?\nA:" |
|
|
|
input_ids = tokenizer(prompt, return_tensors="pt").input_ids.cuda() |
|
|
|
generated_ids = model.generate(input_ids) |
|
|
|
tokenizer.batch_decode(generated_ids, skip_special_tokens=True) |
|
|
|
|
|
``` |
|
|
|
### Limitations and Biases |
|
|
|
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. |
|
|
|
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. |
|
|
|
## Use case |
|
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. |
|
|
|
Good at: Text parsing, simple classification, and keyword recognition are all strengths. |
|
|
|
|
|
|
|
## Citation and Related Information |
|
|
|
|
|
To cite this model: |
|
``` |
|
@misc{Palmyra, |
|
author = {Writer AI team}, |
|
title = {{Palmyra-small Parameter Autoregressive Language Model}}, |
|
howpublished = {\url{https://github.com/kingoflolz/mesh-transformer-jax}}, |
|
year = 2023, |
|
month = January |
|
} |
|
``` |
|
|
|
|