README update
Browse files
README.md
CHANGED
@@ -1,3 +1,41 @@
|
|
1 |
---
|
2 |
license: cc-by-nc-sa-4.0
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: cc-by-nc-sa-4.0
|
3 |
---
|
4 |
+
|
5 |
+
[skt/kogpt2-base-v2](https://huggingface.co/skt/kogpt2-base-v2)λ₯Ό AIHub μΌμλν λ°μ΄ν°μ
μΌλ‘ νμΈνλν λͺ¨λΈμ
λλ€.<br/>
|
6 |
+
νμ΅ μ½λ: https://github.com/HeegyuKim/open-domain-dialog<br/>
|
7 |
+
Streamlit Demo: https://heegyukim-open-domain-dialog-st-demo-1tzktp.streamlitapp.com/<br/>
|
8 |
+
|
9 |
+
|
10 |
+
## μ¬μ©μμ
|
11 |
+
```
|
12 |
+
tokenizer = AutoTokenizer.from_pretrained("heegyu/kodialogpt")
|
13 |
+
model = AutoModelForCausalLM.from_pretrained("heegyu/kodialogpt")
|
14 |
+
generator = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
15 |
+
|
16 |
+
generation_args = dict(
|
17 |
+
num_beams=4,
|
18 |
+
repetition_penalty=2.0,
|
19 |
+
no_repeat_ngram_size=4,
|
20 |
+
eos_token_id=375, # \n
|
21 |
+
max_new_tokens=64,
|
22 |
+
do_sample=True,
|
23 |
+
top_k=50,
|
24 |
+
early_stopping=True
|
25 |
+
)
|
26 |
+
generator(
|
27 |
+
["0 : **λ κ²μ μ’μνλ\n1 :",
|
28 |
+
"0 : μ΄μ κ°λ¨μμ μ΄μΈμ¬κ±΄ λ¬λ γ
γ
λ무 무μμ\n1 : ν μ? λ¬΄μ¨ μΌ μμμ΄?\n0 : μ¬μ§λ³΄λκΉ λ§ νΌν리λ μ¬λμκ³ κ²½μ°°λ€μ΄ λ μ μ μνκ³ λ리λ μλμλ€λλ°??\n1 :",
|
29 |
+
"0 : μκΈ°μΌ μ΄μ λ λνν
μ κ·Έλ¬μ΄?\n1 : λ μΌ μμμ΄?\n0 : μ΄λ»κ² λνν
λ§λ μμ΄ κ·Έλ΄ μ μμ΄? λ μ§μ§ μ€λ§νμ΄\n1 : "],
|
30 |
+
**generation_args
|
31 |
+
)
|
32 |
+
```
|
33 |
+
κ²°κ³Ό
|
34 |
+
- eos_token_idλ₯Ό '\n'μΌλ‘ ν΄μ€μ μ§€λ €μΌνλλ° generationλκ±° 보λ μ지리λ€μ... μ΄μ κ° λμ§ γ
|
35 |
+
```
|
36 |
+
[[{'generated_text': '0 : **λ κ²μ μ’μνλ\n1 : ν€ν€ λ κ²μ μ’μνλ₯\n'}],
|
37 |
+
[{'generated_text': '0 : μ΄μ κ°λ¨μμ μ΄μΈμ¬κ±΄ λ¬λ γ
γ
λ무 무μμ\n1 : ν μ? λ¬΄μ¨ μΌ μμμ΄?\n0 : μ¬μ§λ³΄λκΉ λ§ νΌν리λ μ¬λμκ³ κ²½μ°°λ€μ΄ λ μ μ μνκ³ λ리λ μλμλ€λλ°??\n1 : ν λ―Έμ³€λ€... μ§μ§ 무μμ κ² λ€\n0 : κ·ΈμΉ κ·Όλ° νΌν΄μκ° νκΈ°λ‘ μ°λ₯Έ κ² κ°μ\n'}],
|
38 |
+
[{'generated_text': '0 : μκΈ°μΌ μ΄μ λ λνν
μ κ·Έλ¬μ΄?\n1 : λ μΌ μμμ΄?\n0 : μ΄λ»κ² λνν
λ§λ μμ΄ κ·Έλ΄ μ μμ΄? λ μ§μ§ μ€λ§νμ΄\n1 : λ λ§νλλ°?\n0 : λ΄κ° λνν
λλΌκ³ νμμ\n'}]]
|
39 |
+
```
|
40 |
+
|
41 |
+
νμ΅μ μ¬μ©ν νμ΄νΌνλΌλ―Έν°
|