mirror of
https://github.com/microsoft/autogen.git
synced 2026-04-20 03:02:16 -04:00
fixing roberta add_prefix_space bug (#546)
* fixing roberta add_prefix_space bug
This commit is contained in:
@@ -542,7 +542,13 @@ class TransformersEstimator(BaseEstimator):
|
||||
)
|
||||
else:
|
||||
return AutoTokenizer.from_pretrained(
|
||||
self._training_args.model_path, use_fast=True
|
||||
self._training_args.model_path,
|
||||
use_fast=True,
|
||||
add_prefix_space=True
|
||||
if "roberta" in self._training_args.model_path
|
||||
else False, # If roberta model, must set add_prefix_space to True to avoid the assertion error at
|
||||
|
||||
# https://github.com/huggingface/transformers/blob/main/src/transformers/models/roberta/tokenization_roberta_fast.py#L249
|
||||
)
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user