kfkas commited on
Commit
1f8db16
โ€ข
1 Parent(s): 65c91f2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -3
README.md CHANGED
@@ -20,13 +20,13 @@ OUTPUT = ๊ฐ label์— ๋งž๋Š” ๋‰ด์Šค ๊ธฐ์‚ฌ ์ œ๋ชฉ์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
20
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
21
 
22
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
23
- model_dir = "kfkas/t5-base-korean-news-title-klue-ynat"
24
  tokenizer = AutoTokenizer.from_pretrained(model_dir)
25
  model = AutoModelForSeq2SeqLM.from_pretrained(model_dir)
26
  model.to(device)
27
 
28
  label_list = ['IT๊ณผํ•™','๊ฒฝ์ œ','์‚ฌํšŒ','์ƒํ™œ๋ฌธํ™”','์„ธ๊ณ„','์Šคํฌ์ธ ','์ •์น˜']
29
- text = "IT๊ณผํ•™"
30
 
31
  inputs = tokenizer.encode(text, max_length=256, truncation=True, return_tensors="pt")
32
  with torch.no_grad():
@@ -38,10 +38,11 @@ with torch.no_grad():
38
  top_p=0.95, # ๋ˆ„์  ํ™•๋ฅ ์ด 95%์ธ ํ›„๋ณด์ง‘ํ•ฉ์—์„œ๋งŒ ์ƒ์„ฑ
39
  )
40
  decoded_output = tokenizer.decode(output, skip_special_tokens=True)[0]
41
- print(predicted_title)
42
  ```
43
 
44
 
 
45
  ## Intended uses & limitations
46
 
47
  More information needed
 
20
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
21
 
22
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
23
+ model_dir = "kfkas/t5-large-korean-news-title-klue-ynat"
24
  tokenizer = AutoTokenizer.from_pretrained(model_dir)
25
  model = AutoModelForSeq2SeqLM.from_pretrained(model_dir)
26
  model.to(device)
27
 
28
  label_list = ['IT๊ณผํ•™','๊ฒฝ์ œ','์‚ฌํšŒ','์ƒํ™œ๋ฌธํ™”','์„ธ๊ณ„','์Šคํฌ์ธ ','์ •์น˜']
29
+ text = "๊ฒฝ์ œ"
30
 
31
  inputs = tokenizer.encode(text, max_length=256, truncation=True, return_tensors="pt")
32
  with torch.no_grad():
 
38
  top_p=0.95, # ๋ˆ„์  ํ™•๋ฅ ์ด 95%์ธ ํ›„๋ณด์ง‘ํ•ฉ์—์„œ๋งŒ ์ƒ์„ฑ
39
  )
40
  decoded_output = tokenizer.decode(output, skip_special_tokens=True)[0]
41
+ print(predicted_title)#์ •๋ถ€ ๊ธฐ์—… ๊ณ ์šฉ์ฐฝ์ถœยท์„ฑ์žฅ ์ด‰์ง„ ์œ„ํ•œ ๊ฒฝ์ œ์ •์ฑ… ํ™•๋Œ€ ์ฃผ๋ชฉ
42
  ```
43
 
44
 
45
+
46
  ## Intended uses & limitations
47
 
48
  More information needed