L1: NLP tasks with a simple interface - {'error': '400: Invalid state'}

L1: NLP tasks with a simple interface

running Building a text summarization app in the lab

text = ('''The tower is 324 metres (1,063 ft) tall, about the same height
        as an 81-storey building, and the tallest structure in Paris. 
        Its base is square, measuring 125 metres (410 ft) on each side. 
        During its construction, the Eiffel Tower surpassed the Washington 
        Monument to become the tallest man-made structure in the world,
        a title it held for 41 years until the Chrysler Building
        in New York City was finished in 1930. It was the first structure 
        to reach a height of 300 metres. Due to the addition of a broadcasting 
        aerial at the top of the tower in 1957, it is now taller than the 
        Chrysler Building by 5.2 metres (17 ft). Excluding transmitters, the 
        Eiffel Tower is the second tallest free-standing structure in France 
        after the Millau Viaduct.''')

get_completion(text)

returns

{'error': '400: Invalid state'}
1 Like

Same error for L2: Image captioning app

1 Like

Getting the same error

I am also getting a similar error.

1 Like

I have been able to continue with the exercise by taking the API URL from here: https://huggingface.co/sshleifer/distilbart-cnn-12-6?inference_api=true and using my own access token (at the end of the Jupiter notebook, it shows how to create it).

I hope this helps you.

1 Like

That did the trick. I used the following

ENDPOINT_URL = 'https://api-inference.huggingface.co/models/sshleifer/distilbart-cnn-12-6'

and my token from hugging face
hf_api_key = 'hf_XYZ'

in the get_completion function .