alphahg commited on
Commit
3d46508
1 Parent(s): e22da41

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -22,12 +22,12 @@ kosum = 'alphahg/pko-t5-small-finetuned-paper-4564652' #'lcw99/t5-base-korean-te
22
  #en_pipe = pipeline('translation', model=en2ko, tokenizer=en2ko, src_lang = "en", tgt_lang = "ko", device_map="auto")
23
  en2ko_model = AutoModelForSeq2SeqLM.from_pretrained(en2ko)
24
 
25
- en_pipe = pipeline('translation', model=en2ko_model, tokenizer=en2ko, src_lang = "en_XX", tgt_lang = "ko_KR", device="cuda:0")
26
  ko_pipe = pipeline('translation', model=ko2en, tokenizer=ko2en, device="cuda:0")
27
- style_pipe = pipeline('translation', model=en2ko_model, tokenizer=en2ko, src_lang = "ko_KR", tgt_lang = "ko_KR", device="cuda:0")
28
 
29
- en_sum = pipeline('summarization', model=ensum, tokenizer=ensum, device="cuda:1")
30
- ko_sum = pipeline('summarization', model=kosum, tokenizer=kosum, device="cuda:1")
31
 
32
  def len_tokens(text, pipe):
33
  return len(pipe.tokenizer(text)['input_ids'])
 
22
  #en_pipe = pipeline('translation', model=en2ko, tokenizer=en2ko, src_lang = "en", tgt_lang = "ko", device_map="auto")
23
  en2ko_model = AutoModelForSeq2SeqLM.from_pretrained(en2ko)
24
 
25
+ en_pipe = pipeline('translation', model=en2ko_model, tokenizer=en2ko, src_lang = "en_XX", tgt_lang = "ko_KR")
26
  ko_pipe = pipeline('translation', model=ko2en, tokenizer=ko2en, device="cuda:0")
27
+ style_pipe = pipeline('translation', model=en2ko_model, tokenizer=en2ko, src_lang = "ko_KR", tgt_lang = "ko_KR")
28
 
29
+ en_sum = pipeline('summarization', model=ensum, tokenizer=ensum)
30
+ ko_sum = pipeline('summarization', model=kosum, tokenizer=kosum)
31
 
32
  def len_tokens(text, pipe):
33
  return len(pipe.tokenizer(text)['input_ids'])