We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 41c8cfe + 8fe1d49 commit d1488fbCopy full SHA for d1488fb
Magic_AI_Storybook/story.py
@@ -5,6 +5,7 @@
5
import threading
6
import sys
7
import os
8
+import re
9
import time
10
import argparse
11
import math
@@ -102,6 +103,10 @@
102
103
print("Please make sure PROMPT_FILE points to a valid file.")
104
sys.exit(1)
105
106
+def strip_fancy_quotes(text):
107
+ text = re.sub(r"[\u2018\u2019]", "'", text)
108
+ text = re.sub(r"[\u201C\u201D]", '"', text)
109
+ return text
110
111
class Position(Enum):
112
TOP = 0
@@ -668,7 +673,7 @@ def _sendchat(self, prompt):
668
673
return None
669
674
670
675
# Send the heard text to ChatGPT and return the result
671
- return response # completion.choices[0].message.content
676
+ return strip_fancy_quotes(response)
672
677
678
679
def parse_args():
0 commit comments