Update README.md
Browse files
README.md
CHANGED
@@ -72,7 +72,7 @@ model = BartForConditionalGeneration.from_pretrained("jjae/kobart-hashtag")
|
|
72 |
def make_tag(text):
|
73 |
input_ids = tokenizer.encode(text, return_tensors="pt").to(device)
|
74 |
output = model.generate(input_ids = input_ids, bos_token_id = model.config.bos_token_id,
|
75 |
-
eos_token_id = model.config.eos_token_id, length_penalty =
|
76 |
decoded_output = tokenizer.decode(output[0], skip_special_tokens=True)
|
77 |
return decoded_output
|
78 |
```
|
|
|
72 |
def make_tag(text):
|
73 |
input_ids = tokenizer.encode(text, return_tensors="pt").to(device)
|
74 |
output = model.generate(input_ids = input_ids, bos_token_id = model.config.bos_token_id,
|
75 |
+
eos_token_id = model.config.eos_token_id, length_penalty = 3.0, max_length = 50, num_beams = 4)
|
76 |
decoded_output = tokenizer.decode(output[0], skip_special_tokens=True)
|
77 |
return decoded_output
|
78 |
```
|