Skip to content

Commit

Permalink
together and mistral language model wrappers to no longer delete afte…
Browse files Browse the repository at this point in the history
…r last ".".

PiperOrigin-RevId: 685414218
Change-Id: I9afa0e49c1610abbe920dd2a5376e7bdc2e08744
  • Loading branch information
jzleibo authored and copybara-github committed Oct 13, 2024
1 parent 89ed637 commit afbecd7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions concordia/language_model/mistral_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,7 @@ def _complete_text(
self._channel,
{'raw_text_length': len(result)},
)
# Remove the occasional sentence fragment from the end of the result.
last_stop = result.rfind('.')
if last_stop >= 0:
result = result[:last_stop + 1]

return result

def _chat_text(
Expand Down
5 changes: 1 addition & 4 deletions concordia/language_model/together_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,7 @@ def sample_text(
self._channel,
{'raw_text_length': len(result)},
)
# Remove the occasional sentence fragment from the end of the result.
last_stop = result.rfind('.')
if last_stop >= 0:
result = result[: last_stop + 1]

return result

@override
Expand Down

0 comments on commit afbecd7

Please sign in to comment.