-
Notifications
You must be signed in to change notification settings - Fork 658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to pass no_repeat_ngram_size
in text_generation
#2022
Comments
Hi @satkg42, the |
Thanks @Wauplin for quick response. I agree that it might not be one of the most used parameters. But in my experience it definitely helps model "rambling" problem, i.e. model going on and on about something. It would be really helpful if this parameter is supported in the API. Let me know if I can contribute in doing so. |
Thanks for the details @satkg42. For now, I would prefer to delay the decision. Adding support for new parameters is not the hardest part. Maintaining them and adding backward compatibility when we want to update/remove them is much harder. That's why I'd rather wait until the "API unification" step is done on our part before adding this. In the meantime, I encourage any user landing on this page to post a comment to show their interest in such an addition. @satkg42 a possible workaround for you in the meantime is to use the from huggingface_hub import InferenceClient
client = InferenceClient(...)
response = client.post(json={"inputs": "this is my test", "parameters": {"no_repeat_ngram_size": 42}}
data = json.loads(response.decode())
... However, this is not compatible with TGI-served models. |
Describe the bug
I am using InferenceClient for generating text with tgi endpoint. To control the repetitive generations we had to use
no_repeat_ngram_size
parameter. But I am getting below errorTypeError: InferenceClient.text_generation() got an unexpected keyword argument 'no_repeat_ngram_size'
But it is supported in GenerationConfig
Reproduction
No response
Logs
System info
The text was updated successfully, but these errors were encountered: