diff --git a/docs/source/en/main_classes/agent.md b/docs/source/en/main_classes/agent.md index fe483d6dde9e60..e5d4f629b0a875 100644 --- a/docs/source/en/main_classes/agent.md +++ b/docs/source/en/main_classes/agent.md @@ -87,6 +87,7 @@ These engines have the following specification: ### HfEngine For convenience, we have added a `HfEngine` that implements this and uses an inference endpoint for the execution of the LLM. +It accepts an argument `stop_sequences` to stop it in its generation, which will be helpful for controlling our LLM engine's output. ```python >>> from transformers import HfEngine @@ -94,12 +95,12 @@ For convenience, we have added a `HfEngine` that implements this and uses an inf >>> messages = [ ... {"role": "user", "content": "Hello, how are you?"}, ... {"role": "assistant", "content": "I'm doing great. How can I help you today?"}, -... {"role": "user", "content": "I'd like to show off how chat templating works!"}, +... {"role": "user", "content": "No need to help, take it easy."}, ... ] ->>> HfEngine()(messages) +>>> HfEngine()(messages, stop_sequences=["conversation"]) -"That sounds like a lot of fun! I'd be happy to help you demonstrate chat templating. Please go ahead and show me how it works." +"That's very kind of you to say! It's always nice to have a relaxed " ``` [[autodoc]] HfEngine