Update README.md
Browse files
README.md
CHANGED
@@ -39,7 +39,7 @@ Developed by https://exnrt.com
|
|
39 |
- Train Loss: 1.6578
|
40 |
- Validation Loss: 1.8115
|
41 |
|
42 |
-
You can also use `t5-small` (77M params) available in mini folder.
|
43 |
|
44 |
## How to use
|
45 |
|
@@ -51,7 +51,7 @@ tokenizer = AutoTokenizer.from_pretrained("Ateeqq/keywords-title-generator", tok
|
|
51 |
model = AutoModelForSeq2SeqLM.from_pretrained("Ateeqq/keywords-title-generator", token='your_token').to(device)
|
52 |
|
53 |
def generate_title(keywords):
|
54 |
-
input_ids = tokenizer(
|
55 |
outputs = model.generate(
|
56 |
input_ids,
|
57 |
num_beams=5,
|
|
|
39 |
- Train Loss: 1.6578
|
40 |
- Validation Loss: 1.8115
|
41 |
|
42 |
+
You can also use `t5-small` (77M params) available in [mini](https://huggingface.co/Ateeqq/keywords-title-generator/tree/main/mini) folder.
|
43 |
|
44 |
## How to use
|
45 |
|
|
|
51 |
model = AutoModelForSeq2SeqLM.from_pretrained("Ateeqq/keywords-title-generator", token='your_token').to(device)
|
52 |
|
53 |
def generate_title(keywords):
|
54 |
+
input_ids = tokenizer(keywords, return_tensors="pt", padding="longest", truncation=True, max_length=24).input_ids.to(device)
|
55 |
outputs = model.generate(
|
56 |
input_ids,
|
57 |
num_beams=5,
|