Harsh Trivedi
commited on
Commit
·
136c305
1
Parent(s):
57280e5
update.
Browse files
README.md
CHANGED
@@ -31,7 +31,7 @@ Please checkout the details in our [github repository](https://github.com/stonyb
|
|
31 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
32 |
from digit_tokenization import enable_digit_tokenization # digit_tokenization.py from https://github.com/stonybrooknlp/teabreac
|
33 |
|
34 |
-
model_name = "teabreac-preasm-large"
|
35 |
tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False) # Fast doesn't work with digit tokenization
|
36 |
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
37 |
enable_digit_tokenization(tokenizer)
|
@@ -44,7 +44,7 @@ input_ids = tokenizer(
|
|
44 |
input_texts, return_tensors="pt",
|
45 |
truncation=True, max_length=800,
|
46 |
add_special_tokens=True, padding=True,
|
47 |
-
)
|
48 |
generated_ids = model.generate(input_ids, min_length=1, max_length=50)
|
49 |
generated_predictions = tokenizer.batch_decode(generated_ids, skip_special_tokens=False)
|
50 |
generated_predictions = [
|
|
|
31 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
32 |
from digit_tokenization import enable_digit_tokenization # digit_tokenization.py from https://github.com/stonybrooknlp/teabreac
|
33 |
|
34 |
+
model_name = "StonyBrookNLP/teabreac-preasm-large"
|
35 |
tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False) # Fast doesn't work with digit tokenization
|
36 |
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
37 |
enable_digit_tokenization(tokenizer)
|
|
|
44 |
input_texts, return_tensors="pt",
|
45 |
truncation=True, max_length=800,
|
46 |
add_special_tokens=True, padding=True,
|
47 |
+
)["input_ids"]
|
48 |
generated_ids = model.generate(input_ids, min_length=1, max_length=50)
|
49 |
generated_predictions = tokenizer.batch_decode(generated_ids, skip_special_tokens=False)
|
50 |
generated_predictions = [
|