Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix minor bug #107

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def _prepare_inputs_for_qg_from_answers_hl(self, sents, answers):
sent = sents[i]
sents_copy = sents[:]

answer_text = answer_text.strip('<pad>')
answer_text = answer_text.strip()

ans_start_idx = sent.index(answer_text)
Expand Down Expand Up @@ -341,9 +342,9 @@ def pipeline(
if isinstance(tokenizer, (str, tuple)):
if isinstance(tokenizer, tuple):
# For tuple we have (tokenizer name, {kwargs})
tokenizer = AutoTokenizer.from_pretrained(tokenizer[0], **tokenizer[1])
tokenizer = AutoTokenizer.from_pretrained(tokenizer[0], **tokenizer[1], use_fast=False)
else:
tokenizer = AutoTokenizer.from_pretrained(tokenizer)
tokenizer = AutoTokenizer.from_pretrained(tokenizer, use_fast=False)

# Instantiate model if needed
if isinstance(model, str):
Expand All @@ -353,7 +354,7 @@ def pipeline(
if ans_model is None:
# load default ans model
ans_model = targeted_task["default"]["ans_model"]
ans_tokenizer = AutoTokenizer.from_pretrained(ans_model)
ans_tokenizer = AutoTokenizer.from_pretrained(ans_model, use_fast=False)
ans_model = AutoModelForSeq2SeqLM.from_pretrained(ans_model)
else:
# Try to infer tokenizer from model or config name (if provided as str)
Expand Down
Loading