This PR deprecates stop_sequences in favor of the stop parameter for the text_generation task.
Context: in both TGI and the text_generationspecs the stop parameter is provide stop tokens to the model. However historically transformers was using the stop_sequences parameter which had been propagated to Inference API and InferenceClient. Since we are now TGI-first (i.e. even transformers models are served with TGI), let's just expose stop.
>>> from huggingface_hub import InferenceClient
>>> InferenceClient("gpt2").text_generation("The capital of France is", stop=["Republic"])
the capital of the French Republic
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Fix https://github.com/huggingface/huggingface_hub/issues/2471 cc @sadra-barikbin.
This PR deprecates
stop_sequences
in favor of thestop
parameter for the text_generation task.Context: in both TGI and the
text_generation
specs thestop
parameter is provide stop tokens to the model. However historicallytransformers
was using thestop_sequences
parameter which had been propagated to Inference API andInferenceClient
. Since we are now TGI-first (i.e. eventransformers
models are served with TGI), let's just exposestop
.