TypeError: postprocess() got an unexpected keyword argument 'model_outputs'

#2
by Rakshit-OSG - opened

Hi,

I'm trying to use the model (not the inference API). Following is my code:

ISSUE WITH KEYWORD EXTRACTION.PNG

Whenever I execute this, I get the error "TypeError: postprocess() got an unexpected keyword argument 'model_outputs".

ISSUE WITH KEYWORD EXTRACTION-2.PNG
ISSUE WITH KEYWORD EXTRACTION-3.PNG
Requesting you all to kindly help me up with this, please.

Hi,

The name of the model outputs parameter seems to have changed in the postprocess function.
Now it is called all_outputs. Can you replace the postprocess function with this:

def postprocess(self, all_outputs):
    results = super().postprocess(
        all_outputs=all_outputs,
        aggregation_strategy=AggregationStrategy.FIRST,
    )
    return np.unique([result.get("word").strip() for result in results])

I will also update the model documentation.

Thanks for noticing!
Thomas De Decker

DeDeckerThomas changed discussion status to closed

Sign up or log in to comment