QuantumIntelligence
commited on
Commit
โข
f3fb870
1
Parent(s):
e924c46
Update README.md
Browse files
README.md
CHANGED
@@ -1,201 +1,132 @@
|
|
1 |
---
|
|
|
2 |
library_name: transformers
|
3 |
-
tags:
|
|
|
|
|
|
|
|
|
|
|
4 |
---
|
5 |
|
6 |
-
#
|
7 |
|
8 |
-
|
9 |
|
|
|
10 |
|
11 |
|
12 |
-
## Model Details
|
13 |
|
14 |
-
###
|
15 |
|
16 |
-
|
|
|
|
|
|
|
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 |
-
|
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 |
-
|
|
|
|
|
29 |
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
35 |
|
36 |
-
|
|
|
|
|
37 |
|
38 |
-
|
39 |
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
-
|
|
|
|
|
43 |
|
44 |
-
|
|
|
45 |
|
46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
-
|
|
|
|
|
49 |
|
50 |
-
|
|
|
51 |
|
52 |
-
### Out-of-Scope Use
|
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 |
-
[More Information Needed]
|
83 |
-
|
84 |
-
### Training Procedure
|
85 |
-
|
86 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
87 |
-
|
88 |
-
#### Preprocessing [optional]
|
89 |
-
|
90 |
-
[More Information Needed]
|
91 |
-
|
92 |
-
|
93 |
-
#### Training Hyperparameters
|
94 |
-
|
95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
96 |
-
|
97 |
-
#### Speeds, Sizes, Times [optional]
|
98 |
-
|
99 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
100 |
-
|
101 |
-
[More Information Needed]
|
102 |
-
|
103 |
-
## Evaluation
|
104 |
-
|
105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
106 |
-
|
107 |
-
### Testing Data, Factors & Metrics
|
108 |
-
|
109 |
-
#### Testing Data
|
110 |
-
|
111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
112 |
-
|
113 |
-
[More Information Needed]
|
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 |
+
license: apache-2.0
|
3 |
library_name: transformers
|
4 |
+
tags:
|
5 |
+
- Korean
|
6 |
+
- LLM
|
7 |
+
- Chatbot
|
8 |
+
- DPO
|
9 |
+
- Intel/neural-chat-7b-v3-3
|
10 |
---
|
11 |
|
12 |
+
# QI-neural-chat-7B-ko-DPO
|
13 |
|
14 |
+
This is a fine tuned model based on the [neural-chat-7b-v3-3](https://huggingface.co/Intel/neural-chat-7b-v3-3) with Korean DPO dataset([Oraca-DPO-Pairs-KO](https://huggingface.co/datasets/Ja-ck/Orca-DPO-Pairs-KO)).
|
15 |
|
16 |
+
It processes Korean language relatively well, so it is useful when creating various applications.
|
17 |
|
18 |
|
|
|
19 |
|
20 |
+
### Basic Usage
|
21 |
|
22 |
+
```
|
23 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, GPTQConfig
|
24 |
+
import transformers
|
25 |
+
import torch
|
26 |
|
|
|
27 |
|
28 |
+
model_id = "QuantumIntelligence/QI-neural-chat-7B-ko-DPO"
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
31 |
+
# model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
|
32 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", load_in_8bit=True) # quantization
|
33 |
|
34 |
+
pipeline = transformers.pipeline(
|
35 |
+
"text-generation",
|
36 |
+
model=model,
|
37 |
+
torch_dtype=torch.float16,
|
38 |
+
device_map="auto",
|
39 |
+
tokenizer=tokenizer,
|
40 |
+
)
|
41 |
|
42 |
+
prompt = """Classify the text into neutral, negative or positive.
|
43 |
+
Text: This movie is definitely one of my favorite movies of its kind. The interaction between respectable and morally strong characters is an ode to chivalry and the honor code amongst thieves and policemen.
|
44 |
+
Sentiment:
|
45 |
+
"""
|
46 |
|
47 |
+
outputs = pipeline(prompt, max_new_tokens=6)
|
48 |
+
print(outputs[0]["generated_text"])
|
49 |
+
```
|
50 |
|
51 |
+
### Using Korean
|
52 |
|
53 |
+
- Sentiment
|
54 |
+
```
|
55 |
+
prompt = """
|
56 |
+
๋ค์ ํ
์คํธ๋ฅผ ์ค๋ฆฝ, ๋ถ์ , ๊ธ์ ์ผ๋ก ๋ถ๋ฅํด์ค.
|
57 |
+
ํ
์คํธ: ํ๋์ ๋ณด๋ ๋น๊ฐ ์ฌ๋ฏ ํ๋ค. ์ฐ์ธํ ๊ธฐ๋ถ์ด ๋ค์ด์ ์ ์ ํ์ ํ ๊น ๊ณ ๋ฏผ์ค์ธ๋ฐ ๊ฐ์ด ๋ง์ค ์ฌ๋์ด ์๋ค.
|
58 |
+
๋ถ๋ฅ:
|
59 |
+
"""
|
60 |
|
61 |
+
outputs = pipeline(prompt, max_new_tokens=6)
|
62 |
+
print(outputs[0]["generated_text"])
|
63 |
+
```
|
64 |
|
65 |
+
- Summarization
|
66 |
+
```
|
67 |
|
68 |
+
prompt = """
|
69 |
+
๊ตญ๋ด ์ฐ๊ตฌ์ง์ด ๋ฏธ๊ตญ, ์๊ตญ ๊ณต๋ ์ฐ๊ตฌํ๊ณผ ์ฒญ๊ฐ ๊ธฐ๋ฅ์ ๊ด์ฌํ๋ ๋จ๋ฐฑ์ง ๊ตฌ์กฐ๋ฅผ ๊ท๋ช
ํ๋ค. ๋์ฒญ ์น๋ฃ๋ฒ์ ๊ฐ๋ฐํ๋ ๋ฐ ๋์์ด ๋ ๊ฒ์ผ๋ก ๋ณด์ธ๋ค.
|
70 |
+
ํฌ์คํ
์ ์กฐ์ค์ ์๋ช
๊ณผํ๊ณผ ๊ต์ ์ฐ๊ตฌํ์ด ๊น๊ดํ ๊ฒฝํฌ๋ ์์ฉํํ๊ณผ ๊ต์ ์ฐ๊ตฌํ, ๋ธ์
ฐ๋ณผ๋ก๋ ์นดํธ๋ฆฌ์น ๋ฏธ๊ตญ ์๋ ์บ๋ฆฌํฌ๋์๋ ๊ต์ ์ฐ๊ตฌํ, ์บ๋กค ๋ก๋น์จ ์๊ตญ ์ฅ์คํผ๋๋ ๊ต์์ ํจ๊ป ์ฒญ๊ฐ ๊ด๋ จ ํน์ ์์ฉ์ฒด ๋จ๋ฐฑ์ง ๊ตฌ์กฐ์ ๋ฉ์ปค๋์ฆ์ ๋ฐํ๋ ๋ฐ ์ฑ๊ณตํ๋ค๊ณ 11์ผ ๋ฐํ๋ค.
|
71 |
+
๊ท ์์ชฝ์๋ ์๋ฆฌ๋ฅผ ๊ฐ์งํ๋ ๋ฌํฝ์ด๊ด๊ณผ ํํ๊ฐ๊ฐ์ ๋ด๋นํ๋ ์ ์ ๊ธฐ๊ด์ด ์๋ค. ์ด ๊ธฐ๊ด๋ค์ ์ธํฌ๋ค์ ์์ฉ์ฒด ๋จ๋ฐฑ์ง์ธ โGPR156โ์ ๊ฐ๊ณ ์๋ค. GPR156์ด ํ์ฑํ๋๋ฉด ์ธํฌ ๋ด G๋จ๋ฐฑ์ง๊ณผ ๊ฒฐํฉํด ์ ํธ๋ฅผ ์ ๋ฌํ๋ค. G๋จ๋ฐฑ์ง์ โ๊ตฌ์๋ ๋ดํด๋ ์คํ์ด๋-๊ฒฐํฉ ๋จ๋ฐฑ์งโ๋ก ์ ํธ๋ฅผ ์ ๋ฌํ๋ ์ค๊ฐ์๋ค.
|
72 |
+
GPR156์ ๋ค๋ฅธ ์์ฉ์ฒด์ ๋ฌ๋ฆฌ ํน๋ณํ ์๊ทน์ด ์์ด๋ ํญ์ ๋์ ํ์ฑ์ ์ ์งํ๋ฉฐ ์ฒญ๊ฐ๊ณผ ํํ ๊ธฐ๋ฅ ์ ์ง์ ํฐ ์ญํ ์ ํ๋ค. ์ ์ฒ์ ์ผ๋ก ์ฒญ๊ฐ ์ฅ์ ๊ฐ ์๋ ํ์๋ค์ ์น๋ฃํ๊ธฐ ์ํด์๋ ์ด ๋จ๋ฐฑ์ง์ ๊ตฌ์กฐ์ ์์ฉ ๋ฉ์ปค๋์ฆ์ ์์์ผ ํ๋ค.
|
73 |
+
์ฐ๊ตฌํ์ ์ด์ ์จ์ ์ํ๋ฏธ๊ฒฝ(Cryo-EM) ๋ถ์๋ฒ์ ์ฌ์ฉํด GPR156๊ณผ GPR156-G๋จ๋ฐฑ์ง ๊ฒฐํฉ ๋ณตํฉ์ฒด๋ฅผ ๊ณ ํด์๋๋ก ๊ด์ฐฐํ๋ค. ์ด๋ฅผ ํตํด ์์ฉ์ฒด๋ฅผ ํ์ฑํํ๋ ์์ฉ์ ์์ด๋ GPR156์ด ๋์ ํ์ฑ์ ์ ์งํ ์ ์๋ ์์ธ์ ์ฐพ์๋ค.
|
74 |
+
GPR156์ ์ธํฌ๋ง์ ํ๋ถํ ์ธ์ง์ง๊ณผ ๊ฒฐํฉํด ํ์ฑํ๋๋ค. ์ธํฌ์ง์ ์๋ G๋จ๋ฐฑ์ง๊ณผ์ ์ํธ์์ฉ์ ํตํด ์์ฒด์ ์ผ๋ก ๊ตฌ์กฐ๋ฅผ ๋ณํ, ๋์ ํ์ฑ์ ์ ์งํ๋ค๋ ์ฌ์ค๋ ํ์ธ๋๋ค.
|
75 |
+
๊ธฐ์กด์ ์๋ ค์ง ์์ฉ์ฒด ๋จ๋ฐฑ์ง๋ค๊ณผ ๋ฌ๋ฆฌ GPR156์ ์ธํฌ๋ง์ ํต๊ณผํ๋ 7๋ฒ์งธ ํ๋ฆญ์ค ๋ง๋จ ๋ถ๋ถ์ ๊ตฌ์กฐ๋ฅผ ์ ์ฐํ๊ฒ ๋ฐ๊พธ๋ฉฐ G๋จ๋ฐฑ์ง๊ณผ์ ๊ฒฐํฉ์ ์ ๋ํ๏ฟฝ๏ฟฝ. ์ด๋ฅผ ํตํด ์ ํธ๋ฅผ ํ์ฑํํจ์ผ๋ก์จ ์๋ฆฌ๋ฅผ ๊ฐ์งํ๋ ๋ฐ ๋์์ ์ฃผ์๋ค.
|
76 |
+
์กฐ ๊ต์๋ โ์ ์ฒ์ ์ผ๋ก ๋์ฒญ๊ณผ ๊ท ํ ๊ฐ๊ฐ ๊ธฐ๋ฅ์ ์ฅ์ ๊ฐ ์๋ ํ์๋ค์ด ๋ง๋คโ๋ฉฐ โ์ด๋ค์ ์ํ ํ๊ธฐ์ ์ธ ์น๋ฃ๋ฒ๊ณผ ์ฝ๋ฌผ ๊ฐ๋ฐ์ ์ด๋ฒ ์ฐ๊ตฌ๊ฐ ํฐ ๋์์ด ๋๊ธธ ๋ฐ๋๋คโ๊ณ ๋งํ๋ค. ์ฐ๊ตฌ ๋
ผ๋ฌธ์ ๊ตญ์ ํ์ ์ง โ๋ค์ด์ฒ ๊ตฌ์กฐ&๋ถ์ ์๋ฌผํโ ์จ๋ผ์ธํ์ ์ต๊ทผ ๊ฒ์ฌ๋๋ค.
|
77 |
|
78 |
+
์ ๋ฌธ์ฅ์ ํ๊ธ๋ก 100์๋ด๋ก ์์ฝํด์ค.
|
79 |
+
์์ฝ:
|
80 |
+
"""
|
81 |
|
82 |
+
outputs = pipeline(prompt, max_new_tokens=256, return_full_text = False, pad_token_id=tokenizer.eos_token_id)&&
|
83 |
+
print(outputs[0]["generated_text"])
|
84 |
|
|
|
85 |
|
86 |
+
```
|
87 |
|
88 |
+
- Question answering
|
89 |
+
```
|
90 |
+
prompt = """
|
91 |
+
์ฐธ๊ฐ์๋ค์ ๋จผ์ fMRI ๊ธฐ๊ธฐ ์์์ ์์ ์ ์ด์ผ๊ธฐ๋ฅผ ์ฝ๋ ๋์ ๋์ ํ๋ ํจํด์ ๊ธฐ๋กํ๋ค. ์ด์ผ๊ธฐ๋ฅผ ๋ค์ ์ฝ์ผ๋ฉด์๋ ์ด์ผ๊ธฐ ์ ๋จ์ด์ ๋ํด ์๊ฐ์๊ฐ ์์ ์ด ๋๋ผ๋ ์๊ธฐ ๊ด๋ จ๋, ๊ธยท๋ถ์ ์ ์๋ฅผ ๋ณด๊ณ ํ๋ค. ์์ง๋ 49๋ช
์ ๋ฐ์ดํฐ๋ ์๊ธฐ ๊ด๋ จ๋์ ๊ธยท๋ถ์ ์ ์ ์ ์์ ๋ฐ๋ผ ๋ค์ฏ ๊ฐ ์์ค์ผ๋ก ๋ถ๋ฅ๋๋ค.
|
92 |
+
์ง๋ฌธ: ์คํ์ ๋์์ด ๋ ์ฌ๋์ ๋ช ๋ช
์ธ๊ฐ? ํ๊ธ๋ก ๋๋ต.
|
93 |
+
๋๋ต:
|
94 |
+
"""
|
95 |
|
96 |
+
outputs = pipeline(prompt, max_new_tokens=30, return_full_text = False)
|
97 |
+
generated_text = outputs[0]["generated_text"]
|
98 |
+
print(generated_text)
|
99 |
|
100 |
+
```
|
101 |
|
102 |
+
- Reasoning
|
103 |
+
```
|
104 |
|
105 |
+
prompt = """
|
106 |
+
๊ฐ ๋ฐฉ์ ๊ณต์ด 5๊ฐ ์๊ณ , ๋ฐฉ์ ์ด ๊ฐ์๋ 4. ์ด ๊ณต์ ๊ฐฏ์๋ ๋ช๊ฐ ์ธ๊ฐ?
|
107 |
+
"""
|
108 |
|
109 |
+
outputs = pipeline(prompt, max_new_tokens=40, return_full_text = False, pad_token_id=tokenizer.eos_token_id)
|
110 |
+
print(outputs[0]["generated_text"])
|
111 |
|
112 |
+
```
|
113 |
|
114 |
+
- Chatbot template
|
115 |
|
116 |
+
```
|
117 |
+
messages = [{"role": "user", "content": "์ข์ ์ทจ๋ฏธ๋ฅผ ๊ฐ์ง๋ ค๋ฉด ์ด๋ป๊ฒ ํ๋์?"}]
|
118 |
+
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
119 |
|
120 |
+
outputs = pipeline(prompt, max_new_tokens=512, do_sample=True, temperature=0.7, top_k=50, top_p=0.95, return_full_text = False)
|
121 |
+
generated_text = outputs[0]["generated_text"]
|
122 |
|
123 |
+
print(generated_text)
|
124 |
|
125 |
+
```
|
126 |
|
127 |
+
### Request
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
|
129 |
+
The support of GPU computing resource is required for the development and implementation of state-of-the-art models.
|
130 |
+
I would appreciate if anyone could help.
|
131 |
|
132 |
+
Email: [email protected]
|