Skip to content

Commit

Permalink
hotfix
Browse files Browse the repository at this point in the history
2024-06-22 13:35:25.542 - skill-ovos-fallback-chatgpt.openvoiceos - ERROR - string index out of range
  • Loading branch information
JarbasAl authored Jun 22, 2024
1 parent 10390e2 commit 50bb3bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ovos_solver_openai_persona/engines.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def stream_utterances(self, query):
for chunk in self._do_streaming_api_request(messages):
answer += chunk
if any(chunk.endswith(p) for p in [".", "!", "?", "\n", ":"]):
if chunk[-2].isdigit() and chunk[-1] == ".":
if len(chunk) >= 2 and chunk[-2].isdigit() and chunk[-1] == ".":
continue # dont split numbers
if answer.strip():
yield answer
Expand Down

0 comments on commit 50bb3bc

Please sign in to comment.