Update README.md
Browse files
README.md
CHANGED
@@ -1,201 +1,101 @@
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
-
tags:
|
|
|
|
|
|
|
4 |
---
|
5 |
|
6 |
-
# Model Card for Model
|
7 |
|
8 |
<!-- Provide a quick summary of what the model is/does. -->
|
9 |
|
10 |
-
|
11 |
-
|
12 |
## Model Details
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
<!-- Provide a longer summary of what this model is. -->
|
17 |
-
|
18 |
-
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
19 |
-
|
20 |
-
- **Developed by:** [More Information Needed]
|
21 |
-
- **Funded by [optional]:** [More Information Needed]
|
22 |
-
- **Shared by [optional]:** [More Information Needed]
|
23 |
-
- **Model type:** [More Information Needed]
|
24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
25 |
-
- **License:** [More Information Needed]
|
26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
27 |
-
|
28 |
-
### Model Sources [optional]
|
29 |
|
30 |
-
|
31 |
-
|
32 |
-
- **
|
33 |
-
- **
|
34 |
-
- **Demo [optional]:** [More Information Needed]
|
35 |
|
36 |
## Uses
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
##
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
#### Factors
|
116 |
-
|
117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
118 |
-
|
119 |
-
[More Information Needed]
|
120 |
-
|
121 |
-
#### Metrics
|
122 |
-
|
123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
124 |
-
|
125 |
-
[More Information Needed]
|
126 |
-
|
127 |
-
### Results
|
128 |
-
|
129 |
-
[More Information Needed]
|
130 |
-
|
131 |
-
#### Summary
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
## Model Examination [optional]
|
136 |
-
|
137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
138 |
-
|
139 |
-
[More Information Needed]
|
140 |
-
|
141 |
-
## Environmental Impact
|
142 |
-
|
143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
144 |
-
|
145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
146 |
-
|
147 |
-
- **Hardware Type:** [More Information Needed]
|
148 |
-
- **Hours used:** [More Information Needed]
|
149 |
-
- **Cloud Provider:** [More Information Needed]
|
150 |
-
- **Compute Region:** [More Information Needed]
|
151 |
-
- **Carbon Emitted:** [More Information Needed]
|
152 |
-
|
153 |
-
## Technical Specifications [optional]
|
154 |
-
|
155 |
-
### Model Architecture and Objective
|
156 |
-
|
157 |
-
[More Information Needed]
|
158 |
-
|
159 |
-
### Compute Infrastructure
|
160 |
-
|
161 |
-
[More Information Needed]
|
162 |
-
|
163 |
-
#### Hardware
|
164 |
-
|
165 |
-
[More Information Needed]
|
166 |
-
|
167 |
-
#### Software
|
168 |
-
|
169 |
-
[More Information Needed]
|
170 |
-
|
171 |
-
## Citation [optional]
|
172 |
-
|
173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
174 |
-
|
175 |
-
**BibTeX:**
|
176 |
-
|
177 |
-
[More Information Needed]
|
178 |
-
|
179 |
-
**APA:**
|
180 |
-
|
181 |
-
[More Information Needed]
|
182 |
-
|
183 |
-
## Glossary [optional]
|
184 |
-
|
185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
186 |
-
|
187 |
-
[More Information Needed]
|
188 |
-
|
189 |
-
## More Information [optional]
|
190 |
-
|
191 |
-
[More Information Needed]
|
192 |
-
|
193 |
-
## Model Card Authors [optional]
|
194 |
-
|
195 |
-
[More Information Needed]
|
196 |
-
|
197 |
-
## Model Card Contact
|
198 |
-
|
199 |
-
[More Information Needed]
|
200 |
-
|
201 |
|
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
+
tags:
|
4 |
+
- SkillEnhanced
|
5 |
+
- mistral
|
6 |
+
license: apache-2.0
|
7 |
---
|
8 |
|
9 |
+
# Model Card for SkillTree Enhanced Model
|
10 |
|
11 |
<!-- Provide a quick summary of what the model is/does. -->
|
12 |
|
|
|
|
|
13 |
## Model Details
|
14 |
|
15 |
+
This model has been enhanced using the SkillTree approach, which applies specific skills extracted from advanced training or fine-tuning processes to improve the model's capabilities in targeted areas.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
+
- **Base Model:** [tokyotech-llm/Swallow-MS-7b-v0.1](https://huggingface.co/tokyotech-llm/Swallow-MS-7b-v0.1)
|
18 |
+
- **Skill Tree:** [HachiML/SkillTree-Chat-Mistral-7B-v0.1](https://huggingface.co/HachiML/SkillTree-Chat-Mistral-7B-v0.1)
|
19 |
+
- **Language(s) (NLP):** Japanese
|
20 |
+
- **Functionality Status:** **Functional** / Non-Functional / Not Verified
|
|
|
21 |
|
22 |
## Uses
|
23 |
|
24 |
+
This section should describe the intended use cases for the enhanced model. It might include scenarios such as code generation, conversational AI, text summarization, or any other specific tasks the model has been enhanced to perform better. Be sure to include any recommendations or limitations on the model's use.
|
25 |
+
|
26 |
+
```Python
|
27 |
+
# Import library
|
28 |
+
import torch
|
29 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
30 |
+
|
31 |
+
# Load model
|
32 |
+
model_name = "HachiML/Swallow-MS-7b-v0.1-ChatSkill"
|
33 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
34 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto")
|
35 |
+
|
36 |
+
# Inference 1 (Instruction)
|
37 |
+
prompt = "<s>[INST] お気に入りの調味料は? [/INST]"
|
38 |
+
input_ids = tokenizer.encode(prompt, add_special_tokens=False, return_tensors="pt")
|
39 |
+
tokens = model.generate(input_ids.to(device=model.device), max_new_tokens=128, temperature=0.99, top_p=0.95, do_sample=True)
|
40 |
+
out = tokenizer.decode(tokens[0], skip_special_tokens=True)
|
41 |
+
print(out)
|
42 |
+
|
43 |
+
# Inference 2 (Chat)
|
44 |
+
messages = [
|
45 |
+
{"role": "user", "content": "お気に入りの調味料は?"},
|
46 |
+
{"role": "assistant", "content": "私は新鮮なレモン汁を絞るのが大好きなんだ。キッチンで何を料理するにしても、ちょうどいい量のピリッとした風味を加えてくれる!"},
|
47 |
+
{"role": "user", "content": "マヨネーズのレシピはありますか?"}
|
48 |
+
]
|
49 |
+
encodeds = tokenizer.apply_chat_template(messages, return_tensors="pt")
|
50 |
+
model_inputs = encodeds.to(device=model.device)
|
51 |
+
generated_ids = model.generate(model_inputs, max_new_tokens=512, do_sample=True)
|
52 |
+
out = tokenizer.batch_decode(generated_ids)
|
53 |
+
print(out[0])
|
54 |
+
```
|
55 |
+
|
56 |
+
## Response Examples
|
57 |
+
|
58 |
+
Below are examples of responses from the model, demonstrating how the SkillTree enhancement has improved its performance.
|
59 |
+
|
60 |
+
### Example 1:
|
61 |
+
|
62 |
+
- **Input:**
|
63 |
+
```
|
64 |
+
[INST] お気に入りの調味料は? [/INST]
|
65 |
+
```
|
66 |
+
- **Output:**
|
67 |
+
```
|
68 |
+
私のお気に入りの調味料は「味噌」です。味噌は、塩、米、大豆を原料として、発酵と熟成をしたペースト状の食品で、日本を代表する調味料です。
|
69 |
+
味噌には、健康メリットがたくさん含まれています。まず、味噌は、発酵食品なので、乳酸菌が含まれています。この乳酸菌が、腸内環境を改善し、体の免疫システムを上げて、病気予防に役立ちます。
|
70 |
+
次に、味噌に含まれている、メチオニンというアミノ酸は、
|
71 |
+
```
|
72 |
+
|
73 |
+
### Example 2:
|
74 |
+
|
75 |
+
- **Input:**
|
76 |
+
```
|
77 |
+
<s> [INST] お気に入りの調味料は? [/INST] 私は新鮮なレモン汁を絞るのが大好きなんだ。キッチンで何を料理するにしても、ちょうどいい量のピリッとした風味を加えてくれる! </s>
|
78 |
+
<s> [INST] マヨネーズのレシピはありますか? [/INST]
|
79 |
+
```
|
80 |
+
- **Output:**
|
81 |
+
```
|
82 |
+
はい!マヨネーズの基本的なレシピです。
|
83 |
+
材料:
|
84 |
+
- 全卵 3~4個
|
85 |
+
- 卵黄 2~3個
|
86 |
+
- 白酢 60ml
|
87 |
+
- 砂糖 10g
|
88 |
+
- 塩 3g
|
89 |
+
- 油 450ml
|
90 |
+
|
91 |
+
手順:
|
92 |
+
|
93 |
+
1. 鍋に60mlの水を入れ、沸騰するギリギリ手前ぐらいの火にかけ、180mlぐらいの水を吸うぐらいのサイズのボールを入れる。
|
94 |
+
2. 水がきらっきらっと沸きはじめたら、すぐに水球をボールから出して、鍋を火から外し、それを鍋に放り投げる。
|
95 |
+
3. 鍋を激しく振ってボールを入れ、鍋を再び火に戻す。すぐに水球からボールが出てしまいますが、焦らずにこの動作を6回繰り返す。途中卵の白身が白くなるぐらいのところで卵黄を入れ、油をいれ、再びこの動作を行ってもよい。
|
96 |
+
4. すぐに鍋を火から外し、冷水で急冷し、ボールを入れ、鍋を冷水に浸け、ボールの底が固まったら白身が白くなったら卵黄を入れ、またボールを入れる、その後も2回ほどこの動作を繰り返す。
|
97 |
+
5. 卵黄を入れたら冷蔵庫に入れて冷水で更に冷やす。
|
98 |
+
6. 数時間する頃、白身をスプーンできれいに取り除いて、白身を入れる白身の鍋を再び��冷蔵庫に戻し、半日ぐらい経ったら完成。
|
99 |
+
マヨネーズのレシピはかなりシンプルなものですが、この方法でつくるマヨネーズはすごくおいしいものとなります。マヨネーズを使っているレシピは本当に沢山あって、とても重宝しますからぜひ試してみて下さい。</s>
|
100 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
|