From dbc93375e847eb5d0f4499c3da8f5f9ed1af445f Mon Sep 17 00:00:00 2001 From: WieslerAA <166396688+WieslerAA@users.noreply.github.com> Date: Thu, 22 Aug 2024 09:36:18 +0200 Subject: [PATCH 1/2] Remove illegal esacpes \, --- aleph_alpha_client/completion.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aleph_alpha_client/completion.py b/aleph_alpha_client/completion.py index 6fe8282..55ea3ec 100644 --- a/aleph_alpha_client/completion.py +++ b/aleph_alpha_client/completion.py @@ -56,11 +56,11 @@ class CompletionRequest: penalty_bias (string, optional) If set, all tokens in this text will be used in addition to the already penalized tokens for repetition penalties. These consist of the already generated completion tokens if ``repetition_penalties_include_completion`` is set to ``true`` - and the prompt tokens, if ``repetition_penalties_include_prompt`` is set to ``true``\, + and the prompt tokens, if ``repetition_penalties_include_prompt`` is set to ``true``, *Potential use case for a chatbot-based completion:* - Instead of using ``repetition_penalties_include_prompt``\, construct a new string with only the chatbot's reponses included. You would leave out any tokens you use for stop sequences (i.e. ``\\nChatbot:``\), and all user messages. + Instead of using ``repetition_penalties_include_prompt``, construct a new string with only the chatbot's reponses included. You would leave out any tokens you use for stop sequences (i.e. ``\\nChatbot:``\), and all user messages. With this bias, if you turn up the repetition penalties, you can avoid having your chatbot repeat itself, but not penalize the chatbot from mirroring language provided by the user. @@ -83,7 +83,7 @@ class CompletionRequest: By default, we will also include any ``stop_sequences`` you have set, since completion performance can be degraded if expected stop sequences are penalized. You can disable this behavior by settings ``penalty_exceptions_include_stop_sequences`` to ``false``\. penalty_exceptions_include_stop_sequences (bool, optional, default true) - By default, we include any ``stop_sequences`` in ``penalty_exceptions``\, to not penalize the presence of stop sequences that are present in few-shot prompts to provide structure to your completions. + By default, we include any ``stop_sequences`` in ``penalty_exceptions``, to not penalize the presence of stop sequences that are present in few-shot prompts to provide structure to your completions. You can set this to ``false`` if you do not want this behavior. From 29282ddbe841e110a1aeaaae8686346bc1a3d8e8 Mon Sep 17 00:00:00 2001 From: WieslerAA <166396688+WieslerAA@users.noreply.github.com> Date: Thu, 22 Aug 2024 10:15:53 +0200 Subject: [PATCH 2/2] Update completion.py --- aleph_alpha_client/completion.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aleph_alpha_client/completion.py b/aleph_alpha_client/completion.py index 55ea3ec..ffb0a2a 100644 --- a/aleph_alpha_client/completion.py +++ b/aleph_alpha_client/completion.py @@ -60,7 +60,7 @@ class CompletionRequest: *Potential use case for a chatbot-based completion:* - Instead of using ``repetition_penalties_include_prompt``, construct a new string with only the chatbot's reponses included. You would leave out any tokens you use for stop sequences (i.e. ``\\nChatbot:``\), and all user messages. + Instead of using ``repetition_penalties_include_prompt``, construct a new string with only the chatbot's reponses included. You would leave out any tokens you use for stop sequences (i.e. ``\\nChatbot:``), and all user messages. With this bias, if you turn up the repetition penalties, you can avoid having your chatbot repeat itself, but not penalize the chatbot from mirroring language provided by the user. @@ -80,7 +80,7 @@ class CompletionRequest: You could set ``penalty_exceptions`` to ``["\\n-"]`` to not penalize the generation of a new list item, but still increase other penalty settings to encourage the generation of new list items without repeating itself. - By default, we will also include any ``stop_sequences`` you have set, since completion performance can be degraded if expected stop sequences are penalized. You can disable this behavior by settings ``penalty_exceptions_include_stop_sequences`` to ``false``\. + By default, we will also include any ``stop_sequences`` you have set, since completion performance can be degraded if expected stop sequences are penalized. You can disable this behavior by settings ``penalty_exceptions_include_stop_sequences`` to ``false``. penalty_exceptions_include_stop_sequences (bool, optional, default true) By default, we include any ``stop_sequences`` in ``penalty_exceptions``, to not penalize the presence of stop sequences that are present in few-shot prompts to provide structure to your completions.