Spaces:
Sleeping
Sleeping
emotion commas fix
Browse files
app.py
CHANGED
@@ -87,9 +87,9 @@ def transform_text(desc, openai_api_key, temperature, llm_chain, num_words,
|
|
87 |
emotions_str = ""
|
88 |
if len(emotions) > 0:
|
89 |
if len(emotions) == 1:
|
90 |
-
emotions_str = "with emotion of " + emotions[0]
|
91 |
else:
|
92 |
-
emotions_str = "with emotions of " + ", ".join(emotions[:-1]) + " and " + emotions[-1]
|
93 |
|
94 |
# translate_to_str = ""
|
95 |
# if translate_to != TRANSLATE_TO_DEFAULT:
|
@@ -106,14 +106,14 @@ def transform_text(desc, openai_api_key, temperature, llm_chain, num_words,
|
|
106 |
elif literary_style == "Knock-knock, ":
|
107 |
literary_style_str = "as a very funny knock-knock joke"
|
108 |
|
109 |
-
character_str = "as if written by The Old Lady Who Swallowed A Fly
|
110 |
if character != CHARACTER_DEFAULT:
|
111 |
if character == "The Old Woman Who Lived In A Shoe":
|
112 |
-
character_str = "as if written by the Old Woman Who Lived In A Shoe
|
113 |
# elif character == "Mary Had A Little Lamb":
|
114 |
-
# character_str = "as if written by Mary from Mary Had A Little Lamb
|
115 |
elif character == "Humpty-Dumpty":
|
116 |
-
character_str = "as if written by Humpty Dumpty
|
117 |
|
118 |
# formatted_prompt = PROMPT_TEMPLATE.format(
|
119 |
# original_words=desc,
|
|
|
87 |
emotions_str = ""
|
88 |
if len(emotions) > 0:
|
89 |
if len(emotions) == 1:
|
90 |
+
emotions_str = ", with an emotion of " + emotions[0]
|
91 |
else:
|
92 |
+
emotions_str = ", with emotions of " + ", ".join(emotions[:-1]) + " and " + emotions[-1]
|
93 |
|
94 |
# translate_to_str = ""
|
95 |
# if translate_to != TRANSLATE_TO_DEFAULT:
|
|
|
106 |
elif literary_style == "Knock-knock, ":
|
107 |
literary_style_str = "as a very funny knock-knock joke"
|
108 |
|
109 |
+
character_str = "as if written by The Old Lady Who Swallowed A Fly"
|
110 |
if character != CHARACTER_DEFAULT:
|
111 |
if character == "The Old Woman Who Lived In A Shoe":
|
112 |
+
character_str = "as if written by the Old Woman Who Lived In A Shoe"
|
113 |
# elif character == "Mary Had A Little Lamb":
|
114 |
+
# character_str = "as if written by Mary from Mary Had A Little Lamb"
|
115 |
elif character == "Humpty-Dumpty":
|
116 |
+
character_str = "as if written by Humpty Dumpty"
|
117 |
|
118 |
# formatted_prompt = PROMPT_TEMPLATE.format(
|
119 |
# original_words=desc,
|