RichardErkhov commited on
Commit
0eb251b
โ€ข
1 Parent(s): 02babc9

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +175 -0
README.md ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ japanese-stablelm-3b-4e1t-instruct - GGUF
11
+ - Model creator: https://huggingface.co/stabilityai/
12
+ - Original model: https://huggingface.co/stabilityai/japanese-stablelm-3b-4e1t-instruct/
13
+
14
+
15
+ | Name | Quant method | Size |
16
+ | ---- | ---- | ---- |
17
+ | [japanese-stablelm-3b-4e1t-instruct.Q2_K.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-3b-4e1t-instruct-gguf/blob/main/japanese-stablelm-3b-4e1t-instruct.Q2_K.gguf) | Q2_K | 1.01GB |
18
+ | [japanese-stablelm-3b-4e1t-instruct.IQ3_XS.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-3b-4e1t-instruct-gguf/blob/main/japanese-stablelm-3b-4e1t-instruct.IQ3_XS.gguf) | IQ3_XS | 1.11GB |
19
+ | [japanese-stablelm-3b-4e1t-instruct.IQ3_S.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-3b-4e1t-instruct-gguf/blob/main/japanese-stablelm-3b-4e1t-instruct.IQ3_S.gguf) | IQ3_S | 1.17GB |
20
+ | [japanese-stablelm-3b-4e1t-instruct.Q3_K_S.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-3b-4e1t-instruct-gguf/blob/main/japanese-stablelm-3b-4e1t-instruct.Q3_K_S.gguf) | Q3_K_S | 1.17GB |
21
+ | [japanese-stablelm-3b-4e1t-instruct.IQ3_M.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-3b-4e1t-instruct-gguf/blob/main/japanese-stablelm-3b-4e1t-instruct.IQ3_M.gguf) | IQ3_M | 1.23GB |
22
+ | [japanese-stablelm-3b-4e1t-instruct.Q3_K.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-3b-4e1t-instruct-gguf/blob/main/japanese-stablelm-3b-4e1t-instruct.Q3_K.gguf) | Q3_K | 1.3GB |
23
+ | [japanese-stablelm-3b-4e1t-instruct.Q3_K_M.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-3b-4e1t-instruct-gguf/blob/main/japanese-stablelm-3b-4e1t-instruct.Q3_K_M.gguf) | Q3_K_M | 1.3GB |
24
+ | [japanese-stablelm-3b-4e1t-instruct.Q3_K_L.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-3b-4e1t-instruct-gguf/blob/main/japanese-stablelm-3b-4e1t-instruct.Q3_K_L.gguf) | Q3_K_L | 1.4GB |
25
+ | [japanese-stablelm-3b-4e1t-instruct.IQ4_XS.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-3b-4e1t-instruct-gguf/blob/main/japanese-stablelm-3b-4e1t-instruct.IQ4_XS.gguf) | IQ4_XS | 1.43GB |
26
+ | [japanese-stablelm-3b-4e1t-instruct.Q4_0.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-3b-4e1t-instruct-gguf/blob/main/japanese-stablelm-3b-4e1t-instruct.Q4_0.gguf) | Q4_0 | 1.5GB |
27
+ | [japanese-stablelm-3b-4e1t-instruct.IQ4_NL.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-3b-4e1t-instruct-gguf/blob/main/japanese-stablelm-3b-4e1t-instruct.IQ4_NL.gguf) | IQ4_NL | 1.51GB |
28
+ | [japanese-stablelm-3b-4e1t-instruct.Q4_K_S.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-3b-4e1t-instruct-gguf/blob/main/japanese-stablelm-3b-4e1t-instruct.Q4_K_S.gguf) | Q4_K_S | 1.51GB |
29
+ | [japanese-stablelm-3b-4e1t-instruct.Q4_K.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-3b-4e1t-instruct-gguf/blob/main/japanese-stablelm-3b-4e1t-instruct.Q4_K.gguf) | Q4_K | 1.59GB |
30
+ | [japanese-stablelm-3b-4e1t-instruct.Q4_K_M.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-3b-4e1t-instruct-gguf/blob/main/japanese-stablelm-3b-4e1t-instruct.Q4_K_M.gguf) | Q4_K_M | 1.59GB |
31
+ | [japanese-stablelm-3b-4e1t-instruct.Q4_1.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-3b-4e1t-instruct-gguf/blob/main/japanese-stablelm-3b-4e1t-instruct.Q4_1.gguf) | Q4_1 | 1.65GB |
32
+ | [japanese-stablelm-3b-4e1t-instruct.Q5_0.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-3b-4e1t-instruct-gguf/blob/main/japanese-stablelm-3b-4e1t-instruct.Q5_0.gguf) | Q5_0 | 1.81GB |
33
+ | [japanese-stablelm-3b-4e1t-instruct.Q5_K_S.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-3b-4e1t-instruct-gguf/blob/main/japanese-stablelm-3b-4e1t-instruct.Q5_K_S.gguf) | Q5_K_S | 1.81GB |
34
+ | [japanese-stablelm-3b-4e1t-instruct.Q5_K.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-3b-4e1t-instruct-gguf/blob/main/japanese-stablelm-3b-4e1t-instruct.Q5_K.gguf) | Q5_K | 1.86GB |
35
+ | [japanese-stablelm-3b-4e1t-instruct.Q5_K_M.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-3b-4e1t-instruct-gguf/blob/main/japanese-stablelm-3b-4e1t-instruct.Q5_K_M.gguf) | Q5_K_M | 1.86GB |
36
+ | [japanese-stablelm-3b-4e1t-instruct.Q5_1.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-3b-4e1t-instruct-gguf/blob/main/japanese-stablelm-3b-4e1t-instruct.Q5_1.gguf) | Q5_1 | 1.96GB |
37
+ | [japanese-stablelm-3b-4e1t-instruct.Q6_K.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-3b-4e1t-instruct-gguf/blob/main/japanese-stablelm-3b-4e1t-instruct.Q6_K.gguf) | Q6_K | 2.14GB |
38
+ | [japanese-stablelm-3b-4e1t-instruct.Q8_0.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-3b-4e1t-instruct-gguf/blob/main/japanese-stablelm-3b-4e1t-instruct.Q8_0.gguf) | Q8_0 | 2.77GB |
39
+
40
+
41
+
42
+
43
+ Original model description:
44
+ ---
45
+ language:
46
+ - ja
47
+ tags:
48
+ - japanese-stablelm
49
+ - causal-lm
50
+ pipeline_tag: text-generation
51
+ license: apache-2.0
52
+ extra_gated_fields:
53
+ Name: text
54
+ Email: text
55
+ Country: text
56
+ Organization or Affiliation: text
57
+ I allow Stability AI to contact me about information related to its models and research: checkbox
58
+ ---
59
+
60
+ # Japanese StableLM-3B-4E1T Instruct
61
+
62
+ ## Model Description
63
+
64
+ This is a 3B-parameter decoder-only Japanese language model fine-tuned on instruction-following datasets, built on top of the base model [Japanese StableLM-3B-4E1T Base](https://huggingface.co/stabilityai/japanese-stablelm-3b-4e1t-base).
65
+
66
+ *If you are in search of a larger model, please check [Japanese Stable LM Instruct Gamma 7B](https://huggingface.co/stabilityai/japanese-stablelm-instruct-gamma-7b)*.
67
+
68
+
69
+ ## Usage
70
+
71
+
72
+ ```python
73
+ import torch
74
+ from transformers import AutoTokenizer, AutoModelForCausalLM
75
+
76
+ tokenizer = AutoTokenizer.from_pretrained("stabilityai/japanese-stablelm-3b-4e1t-instruct")
77
+ model = AutoModelForCausalLM.from_pretrained(
78
+ "stabilityai/japanese-stablelm-3b-4e1t-instruct",
79
+ trust_remote_code=True,
80
+ torch_dtype="auto",
81
+ )
82
+ model.eval()
83
+
84
+ if torch.cuda.is_available():
85
+ model = model.to("cuda")
86
+
87
+ def build_prompt(user_query, inputs="", sep="\n\n### "):
88
+ sys_msg = "ไปฅไธ‹ใฏใ€ใ‚ฟใ‚นใ‚ฏใ‚’่ชฌๆ˜Žใ™ใ‚‹ๆŒ‡็คบใจใ€ๆ–‡่„ˆใฎใ‚ใ‚‹ๅ…ฅๅŠ›ใฎ็ต„ใฟๅˆใ‚ใ›ใงใ™ใ€‚่ฆๆฑ‚ใ‚’้ฉๅˆ‡ใซๆบ€ใŸใ™ๅฟœ็ญ”ใ‚’ๆ›ธใใชใ•ใ„ใ€‚"
89
+ p = sys_msg
90
+ roles = ["ๆŒ‡็คบ", "ๅฟœ็ญ”"]
91
+ msgs = [": \n" + user_query, ": \n"]
92
+ if inputs:
93
+ roles.insert(1, "ๅ…ฅๅŠ›")
94
+ msgs.insert(1, ": \n" + inputs)
95
+ for role, msg in zip(roles, msgs):
96
+ p += sep + role + msg
97
+ return p
98
+
99
+ # Infer with prompt without any additional input
100
+ user_inputs = {
101
+ "user_query": "ไธŽใˆใ‚‰ใ‚ŒใŸใ“ใจใ‚ใ–ใฎๆ„ๅ‘ณใ‚’ๅฐๅญฆ็”Ÿใงใ‚‚ๅˆ†ใ‹ใ‚‹ใ‚ˆใ†ใซๆ•™ใˆใฆใใ ใ•ใ„ใ€‚",
102
+ "inputs": "ๆƒ…ใ‘ใฏไบบใฎใŸใ‚ใชใ‚‰ใš"
103
+ }
104
+ prompt = build_prompt(**user_inputs)
105
+
106
+ input_ids = tokenizer.encode(
107
+ prompt,
108
+ add_special_tokens=False,
109
+ return_tensors="pt"
110
+ )
111
+
112
+ tokens = model.generate(
113
+ input_ids.to(device=model.device),
114
+ max_new_tokens=256,
115
+ temperature=1,
116
+ top_p=0.95,
117
+ do_sample=True,
118
+ )
119
+
120
+ out = tokenizer.decode(tokens[0][input_ids.shape[1]:], skip_special_tokens=True).strip()
121
+ print(out)
122
+ ```
123
+
124
+ ## Model Details
125
+
126
+ * **Developed by**: [Stability AI](https://stability.ai/)
127
+ * **Model type**: `Japanese StableLM-3B-4E1T Instruct` model is an auto-regressive language model based on the transformer decoder architecture.
128
+ * **Language(s)**: Japanese
129
+ * **License**: This model is licensed under [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).
130
+ * **Contact**: For questions and comments about the model, please join [Stable Community Japan](https://discord.gg/StableJP). For future announcements / information about Stability AI models, research, and events, please follow https://twitter.com/StabilityAI_JP.
131
+
132
+ ### Model Architecture
133
+
134
+ The model is a decoder-only transformer similar to the LLaMA ([Touvron et al., 2023](https://arxiv.org/abs/2307.09288)) architecture with the following modifications:
135
+
136
+ | Parameters | Hidden Size | Layers | Heads | Sequence Length |
137
+ |----------------|-------------|--------|-------|-----------------|
138
+ | 2,795,443,200 | 2560 | 32 | 32 | 4096 |
139
+
140
+ * **Position Embeddings**: Rotary Position Embeddings ([Su et al., 2021](https://arxiv.org/abs/2104.09864)) applied to the first 25% of head embedding dimensions for improved throughput following [Black et al. (2022)](https://arxiv.org/pdf/2204.06745.pdf).
141
+ * **Normalization**: LayerNorm ([Ba et al., 2016](https://arxiv.org/abs/1607.06450)) with learned bias terms as opposed to RMSNorm ([Zhang & Sennrich, 2019](https://arxiv.org/abs/1910.07467)).
142
+ * **Tokenizer**: GPT-NeoX ([Black et al., 2022](https://arxiv.org/abs/2204.06745)).
143
+
144
+
145
+ ### Training Datasets
146
+
147
+ - [Japanese translation of the Databricks Dolly-15k dataset](https://huggingface.co/datasets/kunishou/databricks-dolly-15k-ja)
148
+ - [Japanese translation of the subset of the Anthropic HH dataset](https://huggingface.co/datasets/fujiki/japanese_hh-rlhf-49k)
149
+ - [Wikinews](https://ja.wikinews.org/wi) [subset](https://huggingface.co/datasets/fujiki/llm-japanese-dataset_wikinews) of the [izumi-lab/llm-japanese-dataset](https://huggingface.co/datasets/izumi-lab/llm-japanese-dataset)
150
+
151
+
152
+
153
+ ## Use and Limitations
154
+
155
+ ### Intended Use
156
+
157
+ The model is intended to be used by all individuals as a foundational model for application-specific fine-tuning without strict limitations on commercial use.
158
+
159
+ ### Limitations and bias
160
+
161
+ The pre-training dataset may have contained offensive or inappropriate content even after applying data cleansing filters which can be reflected in the model-generated text. We recommend users exercise reasonable caution when using these models in production systems. Do not use the model for any applications that may cause harm or distress to individuals or groups.
162
+
163
+ ## Credits
164
+
165
+ The fine-tuning was carried out by [Fujiki Nakamura](https://huggingface.co/fujiki).
166
+ Other aspects, including data preparation and evaluation, were handled by the Language Team of Stability AI Japan, notably [Meng Lee](https://huggingface.co/leemeng), [Makoto Shing](https://huggingface.co/mkshing), [Paul McCann](https://huggingface.co/polm-stability), [Naoki Orii](https://huggingface.co/mrorii), and [Takuya Akiba](https://huggingface.co/iwiwi).
167
+
168
+ ## Acknowledgements
169
+
170
+ We are grateful for the contributions of the EleutherAI Polyglot-JA team in helping us to collect a large amount of pre-training data in Japanese. Polyglot-JA members includes Hyunwoong Ko (Project Lead), Fujiki Nakamura (originally started this project when he commited to the Polyglot team), Yunho Mo, Minji Jung, KeunSeok Im, and Su-Kyeong Jang.
171
+
172
+ We are also appreciative of [AI Novelist/Sta (Bit192, Inc.)](https://ai-novel.com/index.php) and the numerous contributors from [Stable Community Japan](https://discord.gg/VPrcE475HB) for assisting us in gathering a large amount of high-quality Japanese textual data for model training.
173
+
174
+
175
+