QuantumIntelligence commited on
Commit
f3fb870
β€’
1 Parent(s): e924c46

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +92 -161
README.md CHANGED
@@ -1,201 +1,132 @@
1
  ---
 
2
  library_name: transformers
3
- tags: []
 
 
 
 
 
4
  ---
5
 
6
- # Model Card for Model ID
7
 
8
- <!-- Provide a quick summary of what the model is/does. -->
9
 
 
10
 
11
 
12
- ## Model Details
13
 
14
- ### Model Description
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
- <!-- Provide the basic links for the model. -->
 
 
 
 
 
 
31
 
32
- - **Repository:** [More Information Needed]
33
- - **Paper [optional]:** [More Information Needed]
34
- - **Demo [optional]:** [More Information Needed]
 
35
 
36
- ## Uses
 
 
37
 
38
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
 
40
- ### Direct Use
 
 
 
 
 
 
41
 
42
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
 
 
43
 
44
- [More Information Needed]
 
45
 
46
- ### Downstream Use [optional]
 
 
 
 
 
 
 
 
47
 
48
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
 
 
49
 
50
- [More Information Needed]
 
51
 
52
- ### Out-of-Scope Use
53
 
54
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
 
56
- [More Information Needed]
 
 
 
 
 
 
57
 
58
- ## Bias, Risks, and Limitations
 
 
59
 
60
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
 
62
- [More Information Needed]
 
63
 
64
- ### Recommendations
 
 
65
 
66
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
 
67
 
68
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
 
70
- ## How to Get Started with the Model
71
 
72
- Use the code below to get started with the model.
 
 
73
 
74
- [More Information Needed]
 
75
 
76
- ## Training Details
77
 
78
- ### Training Data
79
 
80
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
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