joeyanuff commited on
Commit
18f4923
1 Parent(s): ee12dbf

end with lit_style

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -20,7 +20,7 @@ CHARACTER_DEFAULT = "The Old Lady Who Swallowed A Fly"
20
  # )
21
  PROMPT_TEMPLATE = PromptTemplate(
22
  input_variables=["num_words", "literary_style", "emotions", "character", "original_words"],
23
- template="{num_words}{literary_style}{character}{emotions} express the following: \n{original_words}\n",
24
  )
25
 
26
  def set_openai_api_key(api_key, openai_api_key, temperature, llm_chain):
@@ -95,14 +95,14 @@ def transform_text(desc, openai_api_key, temperature, llm_chain, num_words,
95
  # if translate_to != TRANSLATE_TO_DEFAULT:
96
  # translate_to_str = "translated to " + translate_to + ", "
97
 
98
- literary_style_str = "as a poem, "
99
  if literary_style != LITERARY_STYLE_DEFAULT:
100
  if literary_style == "Haiku":
101
- literary_style_str = "as a haiku, "
102
  elif literary_style == "Limerick":
103
- literary_style_str = "as a limerick, "
104
  # elif literary_style == "Joke":
105
- # literary_style_str = "as a very funny joke with a setup and punchline, "
106
  elif literary_style == "Knock-knock, ":
107
  literary_style_str = "as a very funny knock-knock joke"
108
 
 
20
  # )
21
  PROMPT_TEMPLATE = PromptTemplate(
22
  input_variables=["num_words", "literary_style", "emotions", "character", "original_words"],
23
+ template="{num_words}{character}{emotions} express the following {literary_style}: \n{original_words}\n",
24
  )
25
 
26
  def set_openai_api_key(api_key, openai_api_key, temperature, llm_chain):
 
95
  # if translate_to != TRANSLATE_TO_DEFAULT:
96
  # translate_to_str = "translated to " + translate_to + ", "
97
 
98
+ literary_style_str = "as a poem"
99
  if literary_style != LITERARY_STYLE_DEFAULT:
100
  if literary_style == "Haiku":
101
+ literary_style_str = "as a haiku"
102
  elif literary_style == "Limerick":
103
+ literary_style_str = "as a limerick"
104
  # elif literary_style == "Joke":
105
+ # literary_style_str = "as a very funny joke with a setup and punchline"
106
  elif literary_style == "Knock-knock, ":
107
  literary_style_str = "as a very funny knock-knock joke"
108