I am using this api endpoint of gpt2 from https://huggingface.co/gpt2
this is given curl request,
" curl -X POST
-H “Authorization: Bearer api_xxxxxxxxxxxxxxxxxxxxxxx”
-H “Content-Type: application/json”
-d ‘“My name is Mariama, my favorite”’
https://api-inference.huggingface.co/models/gpt2 "
The problem is this request only specifies start of the output text. “my name is marima, my favorite” in this case.
But when using transformers you can specify max lenght of output too with
>>> generator("Hello, I'm a language model,", max_length=30, num_return_sequences=5)
is it achievable with inference api ? Probably something like below request.
" curl -X POST
-H “Authorization: Bearer api_xxxxxxxxxxxxxxxxxxxxxxx”
-H “Content-Type: application/json”
-d ‘“My name is Mariama, my favorite”’
-d “max_length = 30”
htt/api-inference.huggingface.co/models/gpt2 "