Commit
Β·
51f763f
1
Parent(s):
ed7398f
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: ko
|
3 |
+
license: mit
|
4 |
+
library_name: transformers
|
5 |
+
pipeline_tag: text2text-generation
|
6 |
+
---
|
7 |
+
|
8 |
+
# FLAN T5
|
9 |
+
|
10 |
+
FLAN T5λ [paust/pko-t5-large](https://huggingface.co/paust/pko-t5-large) λͺ¨λΈμ κΈ°λ°μΌλ‘ λ€μν νμ€ν¬λ₯Ό instruction finetuningμ ν΅ν΄μ λ§λ λͺ¨λΈμ
λλ€.
|
11 |
+
|
12 |
+
νμ¬ κ³μ Instruction Finetuning μ μ§ννλ©΄μ μ€κ°κ²°κ³Όλ₯Ό λͺ¨λΈλ‘ μ
λ°μ΄νΈνκ³ μμ΅λλ€.
|
13 |
+
|
14 |
+
### νμ΅λ νμ€ν¬
|
15 |
+
|
16 |
+
| Task name | Task type |
|
17 |
+
|----------------------------|----------------|
|
18 |
+
| NSMC | Classification |
|
19 |
+
| Klue Ynat | Classification |
|
20 |
+
| KorNLI | Classification |
|
21 |
+
| KorSTS | Classification |
|
22 |
+
| QuestionPair | Classification |
|
23 |
+
| Klue STS | Classification |
|
24 |
+
| AIHub news Summary | Summarization |
|
25 |
+
| AIHub document Summary | Summarization |
|
26 |
+
| AIHub book Summary | Summarization |
|
27 |
+
| AIHub conversation Summary | Summarization |
|
28 |
+
| AIHub ko-to-en | Translation |
|
29 |
+
| AIHub ko-to-en Expert | Translation |
|
30 |
+
| AIHub ko-to-en Tech | Translation |
|
31 |
+
| AIHub ko-to-en social | Translation |
|
32 |
+
| AIHub ko-to-jp | Translation |
|
33 |
+
| AIHub ko-to-cn Tech | Translation |
|
34 |
+
| AIHub Translation Corpus | Translation |
|
35 |
+
| korquad | QA |
|
36 |
+
| Klue MRC | QA |
|
37 |
+
| AIHub mindslab's MRC | QA |
|
38 |
+
|
39 |
+
|
40 |
+
### λͺ¨λΈ
|
41 |
+
- [Hugginface λ§ν¬](https://huggingface.co/paust/pko-flan-t5-large)
|
42 |
+
|
43 |
+
|
44 |
+
### μ¬μ© μμ
|
45 |
+
```python
|
46 |
+
from transformers import T5ForConditionalGeneration, T5TokenizerFast
|
47 |
+
|
48 |
+
tokenizer = T5TokenizerFast.from_pretrained('paust/pko-flan-t5-large')
|
49 |
+
model = T5ForConditionalGeneration.from_pretrained('paust/pko-flan-t5-large', device_map='cuda')
|
50 |
+
|
51 |
+
prompt = """μμΈνΉλ³μ(μμΈηΉε₯εΈ, μμ΄: Seoul Metropolitan Government)λ λνλ―Όκ΅ μλμ΄μ μ΅λ λμμ΄λ€. μ μ¬μλλΆν° μ¬λμ΄ κ±°μ£ΌνμμΌλ λ³Έ μμ¬λ λ°±μ 첫 μλ μλ‘μ±μ μμ΄λ‘ νλ€. μΌκ΅μλμλ μ λ΅μ μμΆ©μ§λ‘μ κ³ κ΅¬λ €, λ°±μ , μ λΌκ° λ²κ°μ μ°¨μ§νμμΌλ©°, κ³ λ € μλμλ μμ€μ λ³κΆμ΄ μΈμμ§ λ¨κ²½(εδΊ¬)μΌλ‘ μ΄λ¦νμλ€.
|
52 |
+
νκ΅μ μλλ μ΄λμ
λκΉ?"""
|
53 |
+
input_ids = tokenizer(prompt, add_special_tokens=True, return_tensors='pt').input_ids
|
54 |
+
output_ids = model.generate(input_ids=input_ids.cuda(), max_new_tokens=32, num_beams=12)
|
55 |
+
text = tokenizer.batch_decode(output_ids, skip_special_tokens=True)[0]
|
56 |
+
print(text) # μμΈνΉλ³μ
|
57 |
+
```
|