"ppocr/git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "25f16f2429630f1911f088ad272c779162f062c4"
Unverified Commit 9beaa85b authored by Thomas Wolf's avatar Thomas Wolf Committed by GitHub
Browse files

Merge pull request #1055 from qipeng/run_squad_fix

Fix #1015 (tokenizer defaults to use_lower_case=True when loading from trained models)
parents e753f249 3bffd2e8
...@@ -467,7 +467,7 @@ def main(): ...@@ -467,7 +467,7 @@ def main():
# Load a trained model and vocabulary that you have fine-tuned # Load a trained model and vocabulary that you have fine-tuned
model = model_class.from_pretrained(args.output_dir) model = model_class.from_pretrained(args.output_dir)
tokenizer = tokenizer_class.from_pretrained(args.output_dir) tokenizer = tokenizer_class.from_pretrained(args.output_dir, do_lower_case=args.do_lower_case)
model.to(args.device) model.to(args.device)
......
...@@ -481,7 +481,7 @@ def main(): ...@@ -481,7 +481,7 @@ def main():
# Save the trained model and the tokenizer # Save the trained model and the tokenizer
if args.do_train and args.local_rank == -1 or torch.distributed.get_rank() == 0: if args.do_train and (args.local_rank == -1 or torch.distributed.get_rank() == 0):
# Create output directory if needed # Create output directory if needed
if not os.path.exists(args.output_dir) and args.local_rank in [-1, 0]: if not os.path.exists(args.output_dir) and args.local_rank in [-1, 0]:
os.makedirs(args.output_dir) os.makedirs(args.output_dir)
...@@ -498,7 +498,7 @@ def main(): ...@@ -498,7 +498,7 @@ def main():
# Load a trained model and vocabulary that you have fine-tuned # Load a trained model and vocabulary that you have fine-tuned
model = model_class.from_pretrained(args.output_dir) model = model_class.from_pretrained(args.output_dir)
tokenizer = tokenizer_class.from_pretrained(args.output_dir) tokenizer = tokenizer_class.from_pretrained(args.output_dir, do_lower_case=args.do_lower_case)
model.to(args.device) model.to(args.device)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment