RichardErkhov commited on
Commit
41afcd7
โ€ข
1 Parent(s): bfda501

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +168 -0
README.md ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-instruct-gamma-7b - GGUF
11
+ - Model creator: https://huggingface.co/stabilityai/
12
+ - Original model: https://huggingface.co/stabilityai/japanese-stablelm-instruct-gamma-7b/
13
+
14
+
15
+ | Name | Quant method | Size |
16
+ | ---- | ---- | ---- |
17
+ | [japanese-stablelm-instruct-gamma-7b.Q2_K.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-instruct-gamma-7b-gguf/blob/main/japanese-stablelm-instruct-gamma-7b.Q2_K.gguf) | Q2_K | 2.53GB |
18
+ | [japanese-stablelm-instruct-gamma-7b.IQ3_XS.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-instruct-gamma-7b-gguf/blob/main/japanese-stablelm-instruct-gamma-7b.IQ3_XS.gguf) | IQ3_XS | 2.81GB |
19
+ | [japanese-stablelm-instruct-gamma-7b.IQ3_S.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-instruct-gamma-7b-gguf/blob/main/japanese-stablelm-instruct-gamma-7b.IQ3_S.gguf) | IQ3_S | 2.96GB |
20
+ | [japanese-stablelm-instruct-gamma-7b.Q3_K_S.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-instruct-gamma-7b-gguf/blob/main/japanese-stablelm-instruct-gamma-7b.Q3_K_S.gguf) | Q3_K_S | 2.95GB |
21
+ | [japanese-stablelm-instruct-gamma-7b.IQ3_M.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-instruct-gamma-7b-gguf/blob/main/japanese-stablelm-instruct-gamma-7b.IQ3_M.gguf) | IQ3_M | 3.06GB |
22
+ | [japanese-stablelm-instruct-gamma-7b.Q3_K.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-instruct-gamma-7b-gguf/blob/main/japanese-stablelm-instruct-gamma-7b.Q3_K.gguf) | Q3_K | 3.28GB |
23
+ | [japanese-stablelm-instruct-gamma-7b.Q3_K_M.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-instruct-gamma-7b-gguf/blob/main/japanese-stablelm-instruct-gamma-7b.Q3_K_M.gguf) | Q3_K_M | 3.28GB |
24
+ | [japanese-stablelm-instruct-gamma-7b.Q3_K_L.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-instruct-gamma-7b-gguf/blob/main/japanese-stablelm-instruct-gamma-7b.Q3_K_L.gguf) | Q3_K_L | 3.56GB |
25
+ | [japanese-stablelm-instruct-gamma-7b.IQ4_XS.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-instruct-gamma-7b-gguf/blob/main/japanese-stablelm-instruct-gamma-7b.IQ4_XS.gguf) | IQ4_XS | 3.67GB |
26
+ | [japanese-stablelm-instruct-gamma-7b.Q4_0.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-instruct-gamma-7b-gguf/blob/main/japanese-stablelm-instruct-gamma-7b.Q4_0.gguf) | Q4_0 | 3.83GB |
27
+ | [japanese-stablelm-instruct-gamma-7b.IQ4_NL.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-instruct-gamma-7b-gguf/blob/main/japanese-stablelm-instruct-gamma-7b.IQ4_NL.gguf) | IQ4_NL | 3.87GB |
28
+ | [japanese-stablelm-instruct-gamma-7b.Q4_K_S.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-instruct-gamma-7b-gguf/blob/main/japanese-stablelm-instruct-gamma-7b.Q4_K_S.gguf) | Q4_K_S | 3.86GB |
29
+ | [japanese-stablelm-instruct-gamma-7b.Q4_K.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-instruct-gamma-7b-gguf/blob/main/japanese-stablelm-instruct-gamma-7b.Q4_K.gguf) | Q4_K | 4.07GB |
30
+ | [japanese-stablelm-instruct-gamma-7b.Q4_K_M.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-instruct-gamma-7b-gguf/blob/main/japanese-stablelm-instruct-gamma-7b.Q4_K_M.gguf) | Q4_K_M | 4.07GB |
31
+ | [japanese-stablelm-instruct-gamma-7b.Q4_1.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-instruct-gamma-7b-gguf/blob/main/japanese-stablelm-instruct-gamma-7b.Q4_1.gguf) | Q4_1 | 4.24GB |
32
+ | [japanese-stablelm-instruct-gamma-7b.Q5_0.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-instruct-gamma-7b-gguf/blob/main/japanese-stablelm-instruct-gamma-7b.Q5_0.gguf) | Q5_0 | 4.65GB |
33
+ | [japanese-stablelm-instruct-gamma-7b.Q5_K_S.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-instruct-gamma-7b-gguf/blob/main/japanese-stablelm-instruct-gamma-7b.Q5_K_S.gguf) | Q5_K_S | 4.65GB |
34
+ | [japanese-stablelm-instruct-gamma-7b.Q5_K.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-instruct-gamma-7b-gguf/blob/main/japanese-stablelm-instruct-gamma-7b.Q5_K.gguf) | Q5_K | 4.78GB |
35
+ | [japanese-stablelm-instruct-gamma-7b.Q5_K_M.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-instruct-gamma-7b-gguf/blob/main/japanese-stablelm-instruct-gamma-7b.Q5_K_M.gguf) | Q5_K_M | 4.78GB |
36
+ | [japanese-stablelm-instruct-gamma-7b.Q5_1.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-instruct-gamma-7b-gguf/blob/main/japanese-stablelm-instruct-gamma-7b.Q5_1.gguf) | Q5_1 | 5.07GB |
37
+ | [japanese-stablelm-instruct-gamma-7b.Q6_K.gguf](https://huggingface.co/RichardErkhov/stabilityai_-_japanese-stablelm-instruct-gamma-7b-gguf/blob/main/japanese-stablelm-instruct-gamma-7b.Q6_K.gguf) | Q6_K | 5.53GB |
38
+
39
+
40
+
41
+
42
+ Original model description:
43
+ ---
44
+ language:
45
+ - ja
46
+ tags:
47
+ - japanese-stablelm
48
+ - causal-lm
49
+ pipeline_tag: text-generation
50
+ license: apache-2.0
51
+ extra_gated_fields:
52
+ Name: text
53
+ Email: text
54
+ Country: text
55
+ Organization or Affiliation: text
56
+ I allow Stability AI to contact me about information related to its models and research: checkbox
57
+ ---
58
+
59
+ # Japanese Stable LM Instruct Gamma 7B
60
+
61
+ ## Model Description
62
+
63
+ This is a 7B-parameter decoder-only Japanese language model fine-tuned on instruction-following datasets, built on top of the base model [Japanese Stable LM Base Gamma 7B](https://huggingface.co/stabilityai/japanese-stablelm-base-gamma-7b).
64
+
65
+ *If you are in search of a smaller model, please check [Japanese StableLM-3B-4E1T Instruct](https://huggingface.co/stabilityai/japanese-stablelm-3b-4e1t-base/blob/main/README.md).*
66
+
67
+ ## Usage
68
+
69
+ Ensure you are using Transformers 4.34.0 or newer.
70
+
71
+ ```python
72
+ import torch
73
+ from transformers import AutoTokenizer, AutoModelForCausalLM
74
+
75
+ tokenizer = AutoTokenizer.from_pretrained("stabilityai/japanese-stablelm-instruct-gamma-7b")
76
+ model = AutoModelForCausalLM.from_pretrained(
77
+ "stabilityai/japanese-stablelm-instruct-gamma-7b",
78
+ torch_dtype="auto",
79
+ )
80
+ model.eval()
81
+
82
+ if torch.cuda.is_available():
83
+ model = model.to("cuda")
84
+
85
+ def build_prompt(user_query, inputs="", sep="\n\n### "):
86
+ sys_msg = "ไปฅไธ‹ใฏใ€ใ‚ฟใ‚นใ‚ฏใ‚’่ชฌๆ˜Žใ™ใ‚‹ๆŒ‡็คบใจใ€ๆ–‡่„ˆใฎใ‚ใ‚‹ๅ…ฅๅŠ›ใฎ็ต„ใฟๅˆใ‚ใ›ใงใ™ใ€‚่ฆๆฑ‚ใ‚’้ฉๅˆ‡ใซๆบ€ใŸใ™ๅฟœ็ญ”ใ‚’ๆ›ธใใชใ•ใ„ใ€‚"
87
+ p = sys_msg
88
+ roles = ["ๆŒ‡็คบ", "ๅฟœ็ญ”"]
89
+ msgs = [": \n" + user_query, ": \n"]
90
+ if inputs:
91
+ roles.insert(1, "ๅ…ฅๅŠ›")
92
+ msgs.insert(1, ": \n" + inputs)
93
+ for role, msg in zip(roles, msgs):
94
+ p += sep + role + msg
95
+ return p
96
+
97
+ # Infer with prompt without any additional input
98
+ user_inputs = {
99
+ "user_query": "ไธŽใˆใ‚‰ใ‚ŒใŸใ“ใจใ‚ใ–ใฎๆ„ๅ‘ณใ‚’ๅฐๅญฆ็”Ÿใงใ‚‚ๅˆ†ใ‹ใ‚‹ใ‚ˆใ†ใซๆ•™ใˆใฆใใ ใ•ใ„ใ€‚",
100
+ "inputs": "ๆƒ…ใ‘ใฏไบบใฎใŸใ‚ใชใ‚‰ใš"
101
+ }
102
+ prompt = build_prompt(**user_inputs)
103
+
104
+ input_ids = tokenizer.encode(
105
+ prompt,
106
+ add_special_tokens=True,
107
+ return_tensors="pt"
108
+ )
109
+
110
+ tokens = model.generate(
111
+ input_ids.to(device=model.device),
112
+ max_new_tokens=256,
113
+ temperature=1,
114
+ top_p=0.95,
115
+ do_sample=True,
116
+ )
117
+
118
+ out = tokenizer.decode(tokens[0][input_ids.shape[1]:], skip_special_tokens=True).strip()
119
+ print(out)
120
+ ```
121
+
122
+ ## Model Details
123
+
124
+ * **Developed by**: [Stability AI](https://stability.ai/)
125
+ * **Model type**: `Japanese Stable LM Instruct Gamma 7B` model is an auto-regressive language model based on the transformer decoder architecture.
126
+ * **Language(s)**: Japanese
127
+ * **License**: This model is licensed under [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).
128
+ * **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.
129
+
130
+ ### Model Architecture
131
+
132
+ For details, please see Mistral AI's [paper](https://arxiv.org/abs/2310.06825) and [release blog post](https://mistral.ai/news/announcing-mistral-7b/).
133
+
134
+
135
+ ### Training Datasets
136
+
137
+ - [Japanese translation of the Databricks Dolly-15k dataset](https://huggingface.co/datasets/kunishou/databricks-dolly-15k-ja)
138
+ - [Japanese translation of the subset of the Anthropic HH dataset](https://huggingface.co/datasets/fujiki/japanese_hh-rlhf-49k)
139
+ - [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)
140
+
141
+
142
+
143
+ ## Use and Limitations
144
+
145
+ ### Intended Use
146
+
147
+ 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.
148
+
149
+ ### Limitations and bias
150
+
151
+ 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.
152
+
153
+ ## Credits
154
+
155
+ The fine-tuning was carried out by [Fujiki Nakamura](https://huggingface.co/fujiki).
156
+ 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).
157
+
158
+
159
+ ## Acknowledgements
160
+
161
+ This model is based on Mistral-7B-v0.1 released by the Mistral AI team. We are grateful to the Mistral AI team for providing such an excellent base model.
162
+
163
+ 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.
164
+
165
+ 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.
166
+
167
+
168
+