RichardErkhov
commited on
uploaded readme
Browse files
README.md
ADDED
@@ -0,0 +1,160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Quantization made by Richard Erkhov.
|
2 |
+
|
3 |
+
[Github](https://github.com/RichardErkhov)
|
4 |
+
|
5 |
+
[Discord](https://discord.gg/pvy7H8DZMG)
|
6 |
+
|
7 |
+
[Request more models](https://github.com/RichardErkhov/quant_request)
|
8 |
+
|
9 |
+
|
10 |
+
nekomata-14b-pfn-qfin - GGUF
|
11 |
+
- Model creator: https://huggingface.co/pfnet/
|
12 |
+
- Original model: https://huggingface.co/pfnet/nekomata-14b-pfn-qfin/
|
13 |
+
|
14 |
+
|
15 |
+
| Name | Quant method | Size |
|
16 |
+
| ---- | ---- | ---- |
|
17 |
+
| [nekomata-14b-pfn-qfin.Q2_K.gguf](https://huggingface.co/RichardErkhov/pfnet_-_nekomata-14b-pfn-qfin-gguf/blob/main/nekomata-14b-pfn-qfin.Q2_K.gguf) | Q2_K | 5.41GB |
|
18 |
+
| [nekomata-14b-pfn-qfin.IQ3_XS.gguf](https://huggingface.co/RichardErkhov/pfnet_-_nekomata-14b-pfn-qfin-gguf/blob/main/nekomata-14b-pfn-qfin.IQ3_XS.gguf) | IQ3_XS | 6.12GB |
|
19 |
+
| [nekomata-14b-pfn-qfin.IQ3_S.gguf](https://huggingface.co/RichardErkhov/pfnet_-_nekomata-14b-pfn-qfin-gguf/blob/main/nekomata-14b-pfn-qfin.IQ3_S.gguf) | IQ3_S | 6.31GB |
|
20 |
+
| [nekomata-14b-pfn-qfin.Q3_K_S.gguf](https://huggingface.co/RichardErkhov/pfnet_-_nekomata-14b-pfn-qfin-gguf/blob/main/nekomata-14b-pfn-qfin.Q3_K_S.gguf) | Q3_K_S | 6.31GB |
|
21 |
+
| [nekomata-14b-pfn-qfin.IQ3_M.gguf](https://huggingface.co/RichardErkhov/pfnet_-_nekomata-14b-pfn-qfin-gguf/blob/main/nekomata-14b-pfn-qfin.IQ3_M.gguf) | IQ3_M | 6.87GB |
|
22 |
+
| [nekomata-14b-pfn-qfin.Q3_K.gguf](https://huggingface.co/RichardErkhov/pfnet_-_nekomata-14b-pfn-qfin-gguf/blob/main/nekomata-14b-pfn-qfin.Q3_K.gguf) | Q3_K | 7.16GB |
|
23 |
+
| [nekomata-14b-pfn-qfin.Q3_K_M.gguf](https://huggingface.co/RichardErkhov/pfnet_-_nekomata-14b-pfn-qfin-gguf/blob/main/nekomata-14b-pfn-qfin.Q3_K_M.gguf) | Q3_K_M | 7.16GB |
|
24 |
+
| [nekomata-14b-pfn-qfin.Q3_K_L.gguf](https://huggingface.co/RichardErkhov/pfnet_-_nekomata-14b-pfn-qfin-gguf/blob/main/nekomata-14b-pfn-qfin.Q3_K_L.gguf) | Q3_K_L | 7.44GB |
|
25 |
+
| [nekomata-14b-pfn-qfin.IQ4_XS.gguf](https://huggingface.co/RichardErkhov/pfnet_-_nekomata-14b-pfn-qfin-gguf/blob/main/nekomata-14b-pfn-qfin.IQ4_XS.gguf) | IQ4_XS | 7.37GB |
|
26 |
+
| [nekomata-14b-pfn-qfin.Q4_0.gguf](https://huggingface.co/RichardErkhov/pfnet_-_nekomata-14b-pfn-qfin-gguf/blob/main/nekomata-14b-pfn-qfin.Q4_0.gguf) | Q4_0 | 7.62GB |
|
27 |
+
| [nekomata-14b-pfn-qfin.IQ4_NL.gguf](https://huggingface.co/RichardErkhov/pfnet_-_nekomata-14b-pfn-qfin-gguf/blob/main/nekomata-14b-pfn-qfin.IQ4_NL.gguf) | IQ4_NL | 7.68GB |
|
28 |
+
| [nekomata-14b-pfn-qfin.Q4_K_S.gguf](https://huggingface.co/RichardErkhov/pfnet_-_nekomata-14b-pfn-qfin-gguf/blob/main/nekomata-14b-pfn-qfin.Q4_K_S.gguf) | Q4_K_S | 7.96GB |
|
29 |
+
| [nekomata-14b-pfn-qfin.Q4_K.gguf](https://huggingface.co/RichardErkhov/pfnet_-_nekomata-14b-pfn-qfin-gguf/blob/main/nekomata-14b-pfn-qfin.Q4_K.gguf) | Q4_K | 8.8GB |
|
30 |
+
| [nekomata-14b-pfn-qfin.Q4_K_M.gguf](https://huggingface.co/RichardErkhov/pfnet_-_nekomata-14b-pfn-qfin-gguf/blob/main/nekomata-14b-pfn-qfin.Q4_K_M.gguf) | Q4_K_M | 8.8GB |
|
31 |
+
| [nekomata-14b-pfn-qfin.Q4_1.gguf](https://huggingface.co/RichardErkhov/pfnet_-_nekomata-14b-pfn-qfin-gguf/blob/main/nekomata-14b-pfn-qfin.Q4_1.gguf) | Q4_1 | 8.4GB |
|
32 |
+
| [nekomata-14b-pfn-qfin.Q5_0.gguf](https://huggingface.co/RichardErkhov/pfnet_-_nekomata-14b-pfn-qfin-gguf/blob/main/nekomata-14b-pfn-qfin.Q5_0.gguf) | Q5_0 | 9.18GB |
|
33 |
+
| [nekomata-14b-pfn-qfin.Q5_K_S.gguf](https://huggingface.co/RichardErkhov/pfnet_-_nekomata-14b-pfn-qfin-gguf/blob/main/nekomata-14b-pfn-qfin.Q5_K_S.gguf) | Q5_K_S | 9.34GB |
|
34 |
+
| [nekomata-14b-pfn-qfin.Q5_K.gguf](https://huggingface.co/RichardErkhov/pfnet_-_nekomata-14b-pfn-qfin-gguf/blob/main/nekomata-14b-pfn-qfin.Q5_K.gguf) | Q5_K | 10.14GB |
|
35 |
+
| [nekomata-14b-pfn-qfin.Q5_K_M.gguf](https://huggingface.co/RichardErkhov/pfnet_-_nekomata-14b-pfn-qfin-gguf/blob/main/nekomata-14b-pfn-qfin.Q5_K_M.gguf) | Q5_K_M | 10.14GB |
|
36 |
+
| [nekomata-14b-pfn-qfin.Q5_1.gguf](https://huggingface.co/RichardErkhov/pfnet_-_nekomata-14b-pfn-qfin-gguf/blob/main/nekomata-14b-pfn-qfin.Q5_1.gguf) | Q5_1 | 9.96GB |
|
37 |
+
| [nekomata-14b-pfn-qfin.Q6_K.gguf](https://huggingface.co/RichardErkhov/pfnet_-_nekomata-14b-pfn-qfin-gguf/blob/main/nekomata-14b-pfn-qfin.Q6_K.gguf) | Q6_K | 11.46GB |
|
38 |
+
| [nekomata-14b-pfn-qfin.Q8_0.gguf](https://huggingface.co/RichardErkhov/pfnet_-_nekomata-14b-pfn-qfin-gguf/blob/main/nekomata-14b-pfn-qfin.Q8_0.gguf) | Q8_0 | 14.03GB |
|
39 |
+
|
40 |
+
|
41 |
+
|
42 |
+
|
43 |
+
Original model description:
|
44 |
+
---
|
45 |
+
license: other
|
46 |
+
license_name: tongyi-qianwen-license
|
47 |
+
license_link: LICENSE
|
48 |
+
language:
|
49 |
+
- en
|
50 |
+
- ja
|
51 |
+
library_name: transformers
|
52 |
+
pipeline_tag: text-generation
|
53 |
+
---
|
54 |
+
|
55 |
+
# nekomata-14b-pfn-qfin
|
56 |
+
|
57 |
+
## Model Description
|
58 |
+
nekomata-14b-pfn-qfin is a fine-tuned model based on [rinna/nekomata-14b](https://huggingface.co/rinna/nekomata-14b/tree/main).
|
59 |
+
This is the base model, which is good at generating continuous sentences for finance.
|
60 |
+
nekomata-14b-pfn-qfin is fine-tuned on 370M tokens from multiple special datasets generated by Preferred Networks, which is clear to use for commercial usage.
|
61 |
+
The fine-tuned were carried out at a 2048 context length.
|
62 |
+
This model is released under [Tongyi Qianwen LICENSE AGREEMENT](https://github.com/QwenLM/Qwen/blob/e8e15962d897714944773cca57fa2e460a3655e8/Tongyi%20Qianwen%20LICENSE%20AGREEMENT).
|
63 |
+
|
64 |
+
The research article is available on [arXiv](https://arxiv.org/abs/2404.10555).
|
65 |
+
|
66 |
+
# Benchmarking
|
67 |
+
The benchmark score is obtained using [Japanese Language Model Financial Evaluation Harness](https://github.com/pfnet-research/japanese-lm-fin-harness)
|
68 |
+
For the benchmark, 0-shot and default prompts are used.
|
69 |
+
```
|
70 |
+
| Task |Metric| nekomaba-14b | Ours |
|
71 |
+
|----------------|------|------|---|------|------|---|------|
|
72 |
+
|chabsa |f1 |0.7381| | |0.7428| | |
|
73 |
+
|cma_basics |acc |0.4737|± |0.0821|0.5263|± |0.0821|
|
74 |
+
|cpa_audit |acc |0.1608|± |0.0184|0.1633|± |0.0186|
|
75 |
+
|fp2 |acc |0.3389|± |0.0217|0.3642|± |0.0221|
|
76 |
+
|security_sales_1|acc |0.4561|± |0.0666|0.5614|± |0.0663|
|
77 |
+
|----------------|------|------|---|------|------|---|------|
|
78 |
+
|OVER ALL | |0.4335 |0.4716 |
|
79 |
+
```
|
80 |
+
## Usage
|
81 |
+
Install the required libraries as follows:
|
82 |
+
```sh
|
83 |
+
>>> python -m pip install numpy sentencepiece torch transformers accelerate transformers_stream_generator tiktoken einops
|
84 |
+
```
|
85 |
+
|
86 |
+
Execute the following python code:
|
87 |
+
```python
|
88 |
+
import torch
|
89 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
90 |
+
|
91 |
+
tokenizer = AutoTokenizer.from_pretrained("pfnet/nekomata-14b-pfn-qfin", trust_remote_code=True)
|
92 |
+
|
93 |
+
# Use GPU with bf16 (recommended for supported devices)
|
94 |
+
# model = AutoModelForCausalLM.from_pretrained("pfnet/nekomata-14b-pfn-qfin", device_map="auto", trust_remote_code=True, bf16=True)
|
95 |
+
|
96 |
+
# Use GPU with fp16
|
97 |
+
# model = AutoModelForCausalLM.from_pretrained("pfnet/nekomata-14b-pfn-qfin", device_map="auto", trust_remote_code=True, fp16=True)
|
98 |
+
|
99 |
+
# Use GPU with fp32
|
100 |
+
# model = AutoModelForCausalLM.from_pretrained("pfnet/nekomata-14b-pfn-qfin", device_map="auto", trust_remote_code=True, fp32=True)
|
101 |
+
|
102 |
+
# Use CPU
|
103 |
+
# model = AutoModelForCausalLM.from_pretrained("pfnet/nekomata-14b-pfn-qfin", device_map="cpu", trust_remote_code=True)
|
104 |
+
|
105 |
+
# Automatically select device and precision
|
106 |
+
model = AutoModelForCausalLM.from_pretrained("pfnet/nekomata-14b-pfn-qfin", device_map="auto", trust_remote_code=True)
|
107 |
+
|
108 |
+
text = "日本銀行は"
|
109 |
+
input_ids = tokenizer(text, return_tensors="pt").input_ids.to(model.device)
|
110 |
+
with torch.no_grad():
|
111 |
+
generated_tokens = model.generate(
|
112 |
+
inputs=input_ids,
|
113 |
+
max_new_tokens=32,
|
114 |
+
do_sample=True,
|
115 |
+
temperature=1.0,
|
116 |
+
repetition_penalty=1.1
|
117 |
+
)[0]
|
118 |
+
generated_text = tokenizer.decode(generated_tokens)
|
119 |
+
print(generated_text)
|
120 |
+
# 日本銀行は、2016年9月に「長短金利操作付き量的・質的金融緩和」を導入し、長期国
|
121 |
+
```
|
122 |
+
|
123 |
+
## Model Details
|
124 |
+
- Model size: 14B
|
125 |
+
- Fine-tuned tokens: 370M tokens (Japanese: 300M tokens, English: 13M tokens, Digits: 14M tokens)
|
126 |
+
- Context length: 2048
|
127 |
+
- Developed by: Preferred Networks, Inc
|
128 |
+
- Model type: Causal decoder-only
|
129 |
+
- Language(s): Japanese and English
|
130 |
+
- License: [Tongyi Qianwen LICENSE AGREEMENT](https://github.com/QwenLM/Qwen/blob/e8e15962d897714944773cca57fa2e460a3655e8/Tongyi%20Qianwen%20LICENSE%20AGREEMENT)
|
131 |
+
|
132 |
+
## Bias, Risks, and Limitations
|
133 |
+
nekomata-14b-pfn-qfin is a new technology that carries risks with use.
|
134 |
+
Testing conducted to date has been in English and Japanese, and has not covered, nor could it cover all scenarios.
|
135 |
+
For these reasons, as with all LLMs, nekomata-14b-pfn-qfin’s potential outputs cannot be predicted in advance, and the model may in some instances produce inaccurate, biased or other objectionable responses to user prompts.
|
136 |
+
This model is not designed for legal, tax, investment, financial, or other advice.
|
137 |
+
Therefore, before deploying any applications of nekomata-14b-pfn-qfin, developers should perform safety testing and tuning tailored to their specific applications of the model.
|
138 |
+
|
139 |
+
## How to cite
|
140 |
+
```
|
141 |
+
@misc{hirano2024,
|
142 |
+
title={Construction of Domain-specified Japanese Large Language Model for Finance through Continual Pre-training},
|
143 |
+
author={Masanori Hirano and Kentaro Imajo},
|
144 |
+
year={2024},
|
145 |
+
eprint={2404.10555},
|
146 |
+
archivePrefix={arXiv},
|
147 |
+
primaryClass={cs.CL}
|
148 |
+
}
|
149 |
+
```
|
150 |
+
|
151 |
+
## Contributors
|
152 |
+
Preferred Networks, Inc.
|
153 |
+
- Masanori Hirano
|
154 |
+
- Kentaro Imajo
|
155 |
+
|
156 |
+
# License
|
157 |
+
[Tongyi Qianwen LICENSE AGREEMENT](https://github.com/QwenLM/Qwen/blob/e8e15962d897714944773cca57fa2e460a3655e8/Tongyi%20Qianwen%20LICENSE%20AGREEMENT)
|
158 |
+
|
159 |
+
|
160 |
+
|