Darong commited on
Commit
e909d54
·
verified ·
1 Parent(s): 4a6127b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +19 -1
README.md CHANGED
@@ -33,7 +33,25 @@ paust/pko-t5-base 모델을 기반으로 영어-한국어 번역을 미세조정
33
 
34
  Use the code below to get started with the model.
35
 
36
- [More Information Needed]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
  ## Training Details
39
 
 
33
 
34
  Use the code below to get started with the model.
35
 
36
+ ```python
37
+ from transformers import pipeline, T5TokenizerFast
38
+
39
+ tokenizer_name = "paust/pko-t5-base"
40
+ tokenizer = T5TokenizerFast.from_pretrained(tokenizer_name)
41
+ model_path = 'Darong/BlueT'
42
+ translator = pipeline("translation", model=model_path, tokenizer=tokenizer, max_length=255)
43
+ # 영어 -> 한국어
44
+ prefix = "E2K: "
45
+ source = "This model is an English-Korean translation model."
46
+ target = translator(prefix + source)
47
+ print(target[0]['translation_text'])
48
+
49
+ # 한국어->영어
50
+ prefix = "K2E: "
51
+ source = "이 모델은 영어-한국어 번역 모델입니다."
52
+ target = translator(prefix + source)
53
+ print(target[0]['translation_text'])
54
+ ```
55
 
56
  ## Training Details
57