Skip to content

Instantly share code, notes, and snippets.

@adibenc
Created February 5, 2023 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adibenc/29fcbb64305ddff102cc2bebd4b87dd0 to your computer and use it in GitHub Desktop.
Save adibenc/29fcbb64305ddff102cc2bebd4b87dd0 to your computer and use it in GitHub Desktop.
err mbart indobenchmark
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[5], line 3
1 idx = 2
2 art = getArt(idx)
----> 3 summarizer(
4 art,
5 min_length=20,
6 max_length=144,
7 )
File ~/miniconda3/envs/tf/lib/python3.9/site-packages/transformers/pipelines/text2text_generation.py:265, in SummarizationPipeline.__call__(self, *args, **kwargs)
241 def __call__(self, *args, **kwargs):
242 r"""
243 Summarize the text(s) given as inputs.
244
(...)
263 ids of the summary.
264 """
--> 265 return super().__call__(*args, **kwargs)
File ~/miniconda3/envs/tf/lib/python3.9/site-packages/transformers/pipelines/text2text_generation.py:165, in Text2TextGenerationPipeline.__call__(self, *args, **kwargs)
136 def __call__(self, *args, **kwargs):
137 r"""
138 Generate the output text(s) using text(s) given as inputs.
139
(...)
162 ids of the generated text.
163 """
--> 165 result = super().__call__(*args, **kwargs)
166 if (
167 isinstance(args[0], list)
168 and all(isinstance(el, str) for el in args[0])
169 and all(len(res) == 1 for res in result)
170 ):
171 return [res[0] for res in result]
File ~/miniconda3/envs/tf/lib/python3.9/site-packages/transformers/pipelines/base.py:1074, in Pipeline.__call__(self, inputs, num_workers, batch_size, *args, **kwargs)
1072 return self.iterate(inputs, preprocess_params, forward_params, postprocess_params)
1073 else:
-> 1074 return self.run_single(inputs, preprocess_params, forward_params, postprocess_params)
File ~/miniconda3/envs/tf/lib/python3.9/site-packages/transformers/pipelines/base.py:1082, in Pipeline.run_single(self, inputs, preprocess_params, forward_params, postprocess_params)
1080 model_inputs = self.preprocess(inputs, **preprocess_params)
1081 model_outputs = self.forward(model_inputs, **forward_params)
-> 1082 outputs = self.postprocess(model_outputs, **postprocess_params)
1083 return outputs
File ~/miniconda3/envs/tf/lib/python3.9/site-packages/transformers/pipelines/text2text_generation.py:202, in Text2TextGenerationPipeline.postprocess(self, model_outputs, return_type, clean_up_tokenization_spaces)
199 record = {f"{self.return_name}_token_ids": output_ids}
200 elif return_type == ReturnType.TEXT:
201 record = {
--> 202 f"{self.return_name}_text": self.tokenizer.decode(
203 output_ids,
204 skip_special_tokens=True,
205 clean_up_tokenization_spaces=clean_up_tokenization_spaces,
206 )
207 }
208 records.append(record)
209 return records
TypeError: decode() got an unexpected keyword argument 'clean_up_tokenization_spaces'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment