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: baida21@naver.com
|