初始化项目,由ModelHub XC社区提供模型
Model: Writer/palmyra-small Source: Original Platform
This commit is contained in:
34
.gitattributes
vendored
Normal file
34
.gitattributes
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ftz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.joblib filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.model filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.npy filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.npz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.parquet filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pb filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pickle filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pkl filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pth filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.rar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||||
|
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tflite filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.wasm filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||||
82
README.md
Normal file
82
README.md
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
---
|
||||||
|
language:
|
||||||
|
- en
|
||||||
|
datasets:
|
||||||
|
- English
|
||||||
|
tags:
|
||||||
|
- text generation
|
||||||
|
- pytorch
|
||||||
|
- causal-lm
|
||||||
|
- Writer-data
|
||||||
|
- NeMo
|
||||||
|
- palmyra
|
||||||
|
pipeline_tag: text-generation
|
||||||
|
library_name: transformers
|
||||||
|
license: apache-2.0
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Palmyra Small 128M
|
||||||
|
|
||||||
|
<style>
|
||||||
|
img {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|[](#model-architecture)|[](#model-architecture)|[](#datasets)
|
||||||
|
|
||||||
|
|
||||||
|
## Model Description
|
||||||
|
|
||||||
|
Palmyra Small was primarily pre-trained with English text. Note that 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 Small is a member of the same family of models that only contain a decoder. As a result, it was pre-trained utilizing the objective of self-supervised causal language modeling. Palmyra Small uses the prompts and general experimental setup from GPT-3 in order to conduct its evaluation per GPT-3.
|
||||||
|
|
||||||
|
## Use case
|
||||||
|
Palmyra Small is the fastest of Writer’s LLMs and can perform important tasks such as text parsing, simple classification, address correction, and keyword recognition. Providing more context drives even better performance.
|
||||||
|
|
||||||
|
|
||||||
|
## Training data
|
||||||
|
|
||||||
|
Palmyra Small (128M) was trained on Writer’s 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. However, the model is best at what it was pre-trained for which is generating text from a prompt.
|
||||||
|
|
||||||
|
### How to use
|
||||||
|
|
||||||
|
This model can be easily loaded using the `AutoModelForCausalLM` functionality:
|
||||||
|
|
||||||
|
```python
|
||||||
|
|
||||||
|
import torch
|
||||||
|
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||||
|
|
||||||
|
model = AutoModelForCausalLM.from_pretrained("Writer/palmyra-small")
|
||||||
|
|
||||||
|
tokenizer = AutoTokenizer.from_pretrained("Writer/palmyra-small")
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Limitations and Biases
|
||||||
|
|
||||||
|
Palmyra Small’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 next statistically likely token is not always the token that produces the most "accurate" text. Never rely on Palmyra Small to produce factually correct results.
|
||||||
|
|
||||||
|
Palmyra Small was trained on Writer’s custom data. As with all language models, it is difficult to predict how Palmyra Small 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.
|
||||||
|
|
||||||
|
|
||||||
|
## Citation and Related Information
|
||||||
|
|
||||||
|
|
||||||
|
To cite this model:
|
||||||
|
```
|
||||||
|
@misc{Palmyra,
|
||||||
|
author = {Writer Engineering Team},
|
||||||
|
title = {{Palmyra-base Parameter Autoregressive Language Model}},
|
||||||
|
howpublished = {\url{https://dev.writer.com}},
|
||||||
|
year = 2023,
|
||||||
|
month = January
|
||||||
|
}
|
||||||
|
```
|
||||||
32
config.json
Normal file
32
config.json
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
"_name_or_path": "Writer/Writer-LLM-small",
|
||||||
|
"activation_function": "gelu",
|
||||||
|
"architectures": [
|
||||||
|
"GPT2LMHeadModel"
|
||||||
|
],
|
||||||
|
"attn_pdrop": 0.1,
|
||||||
|
"bos_token_id": 50256,
|
||||||
|
"embd_pdrop": 0.1,
|
||||||
|
"eos_token_id": 50256,
|
||||||
|
"initializer_range": 0.023,
|
||||||
|
"layer_norm_epsilon": 1e-05,
|
||||||
|
"model_type": "gpt2",
|
||||||
|
"n_embd": 768,
|
||||||
|
"n_head": 12,
|
||||||
|
"n_inner": 3072,
|
||||||
|
"n_layer": 12,
|
||||||
|
"n_positions": 2048,
|
||||||
|
"reorder_and_upcast_attn": false,
|
||||||
|
"resid_pdrop": 0.1,
|
||||||
|
"scale_attn_by_inverse_layer_idx": false,
|
||||||
|
"scale_attn_weights": true,
|
||||||
|
"summary_activation": null,
|
||||||
|
"summary_first_dropout": 0.1,
|
||||||
|
"summary_proj_to_labels": true,
|
||||||
|
"summary_type": "cls_index",
|
||||||
|
"summary_use_proj": true,
|
||||||
|
"torch_dtype": "float32",
|
||||||
|
"transformers_version": "4.24.0",
|
||||||
|
"use_cache": true,
|
||||||
|
"vocab_size": 50257
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:d54887684c3b19d449b0929c2d9b655aeacbe376d31c6d839965f188a5a688fd
|
||||||
|
size 322526
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:3abef7a3b2016e274626942bf48438e5f56c27d62461c4c12141b2645d1e5350
|
||||||
|
size 496003844
|
||||||
18
coreml/text-generation/float32_model.mlpackage/Manifest.json
Normal file
18
coreml/text-generation/float32_model.mlpackage/Manifest.json
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"fileFormatVersion": "1.0.0",
|
||||||
|
"itemInfoEntries": {
|
||||||
|
"3FFEE441-1AD5-4D85-9848-75A3D51396BB": {
|
||||||
|
"author": "com.apple.CoreML",
|
||||||
|
"description": "CoreML Model Weights",
|
||||||
|
"name": "weights",
|
||||||
|
"path": "com.apple.CoreML/weights"
|
||||||
|
},
|
||||||
|
"B1C694CC-0B10-451C-B682-70C4B7DC1CB8": {
|
||||||
|
"author": "com.apple.CoreML",
|
||||||
|
"description": "CoreML Model Specification",
|
||||||
|
"name": "model.mlmodel",
|
||||||
|
"path": "com.apple.CoreML/model.mlmodel"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rootModelIdentifier": "B1C694CC-0B10-451C-B682-70C4B7DC1CB8"
|
||||||
|
}
|
||||||
50001
merges.txt
Normal file
50001
merges.txt
Normal file
File diff suppressed because it is too large
Load Diff
3
model.safetensors
Normal file
3
model.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:72d6eb687c783fe5d726902fdaaf99c59e8a3476eec0a6df0d0c530f849a2025
|
||||||
|
size 551254064
|
||||||
3
pytorch_model.bin
Normal file
3
pytorch_model.bin
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:6921cac57faf7302a5a7614be16602556eb58dc2055fb48fd2ebf905aa5d365e
|
||||||
|
size 551292477
|
||||||
5
special_tokens_map.json
Normal file
5
special_tokens_map.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"bos_token": "<|endoftext|>",
|
||||||
|
"eos_token": "<|endoftext|>",
|
||||||
|
"unk_token": "<|endoftext|>"
|
||||||
|
}
|
||||||
100304
tokenizer.json
Normal file
100304
tokenizer.json
Normal file
File diff suppressed because it is too large
Load Diff
10
tokenizer_config.json
Normal file
10
tokenizer_config.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"add_prefix_space": false,
|
||||||
|
"bos_token": "<|endoftext|>",
|
||||||
|
"eos_token": "<|endoftext|>",
|
||||||
|
"model_max_length": 1024,
|
||||||
|
"name_or_path": "gpt2",
|
||||||
|
"special_tokens_map_file": null,
|
||||||
|
"tokenizer_class": "GPT2Tokenizer",
|
||||||
|
"unk_token": "<|endoftext|>"
|
||||||
|
}
|
||||||
1
vocab.json
Normal file
1
vocab.json
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user