Calculate perplexity function

hello i’m struggling with the calculate_perplexity function and I cannot understand where I went wrong. any help is appreciated

Remove the float on the last 1/N but it seems the problem might not be here in this function, might be at the estimate_propability function, because seems to be ok.

Also posting code solution publicly is not allowed.

sure ill keep that in mind! also all test cases passed in estimate probability function so I cant figure out where the problem is…