JLW commited on
Commit
f3e2994
·
1 Parent(s): a3ea15f

Add Neanderthal language, and Story, Rap, FAQ literary styles.

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -183,6 +183,8 @@ def transform_text(desc, express_chain, num_words, formality,
183
  if literary_style != LITERARY_STYLE_DEFAULT:
184
  if literary_style == "Prose":
185
  literary_style_str = "as prose, "
 
 
186
  elif literary_style == "Summary":
187
  literary_style_str = "as a summary, "
188
  elif literary_style == "Outline":
@@ -195,10 +197,14 @@ def transform_text(desc, express_chain, num_words, formality,
195
  literary_style_str = "as a haiku, "
196
  elif literary_style == "Limerick":
197
  literary_style_str = "as a limerick, "
 
 
198
  elif literary_style == "Joke":
199
  literary_style_str = "as a very funny joke with a setup and punchline, "
200
  elif literary_style == "Knock-knock":
201
  literary_style_str = "as a very funny knock-knock joke, "
 
 
202
 
203
  formatted_prompt = PROMPT_TEMPLATE.format(
204
  original_words=desc,
@@ -708,7 +714,7 @@ with gr.Blocks(css=".gradio-container {background-color: lightgray}") as block:
708
  "Korean", "Norwegian", "Polish",
709
  "Portuguese (Brazilian)", "Portuguese (European)", "Romanian", "Russian", "Spanish (European)",
710
  "Spanish (Mexican)", "Spanish (US)", "Swedish", "Turkish", "Ukrainian", "Welsh",
711
- "emojis", "Gen Z slang", "how the stereotypical Karen would say it", "Klingon",
712
  "Pirate", "Strange Planet expospeak technical talk", "Yoda"],
713
  value=TRANSLATE_TO_DEFAULT)
714
 
@@ -726,8 +732,8 @@ with gr.Blocks(css=".gradio-container {background-color: lightgray}") as block:
726
 
727
  with gr.Tab("Lit style"):
728
  literary_style_radio = gr.Radio(label="Literary style:", choices=[
729
- LITERARY_STYLE_DEFAULT, "Prose", "Summary", "Outline", "Bullets", "Poetry", "Haiku", "Limerick", "Joke",
730
- "Knock-knock"],
731
  value=LITERARY_STYLE_DEFAULT)
732
 
733
  literary_style_radio.change(update_foo,
 
183
  if literary_style != LITERARY_STYLE_DEFAULT:
184
  if literary_style == "Prose":
185
  literary_style_str = "as prose, "
186
+ if literary_style == "Story":
187
+ literary_style_str = "as a story, "
188
  elif literary_style == "Summary":
189
  literary_style_str = "as a summary, "
190
  elif literary_style == "Outline":
 
197
  literary_style_str = "as a haiku, "
198
  elif literary_style == "Limerick":
199
  literary_style_str = "as a limerick, "
200
+ elif literary_style == "Rap":
201
+ literary_style_str = "as a rap, "
202
  elif literary_style == "Joke":
203
  literary_style_str = "as a very funny joke with a setup and punchline, "
204
  elif literary_style == "Knock-knock":
205
  literary_style_str = "as a very funny knock-knock joke, "
206
+ elif literary_style == "FAQ":
207
+ literary_style_str = "as a FAQ with several questions and answers, "
208
 
209
  formatted_prompt = PROMPT_TEMPLATE.format(
210
  original_words=desc,
 
714
  "Korean", "Norwegian", "Polish",
715
  "Portuguese (Brazilian)", "Portuguese (European)", "Romanian", "Russian", "Spanish (European)",
716
  "Spanish (Mexican)", "Spanish (US)", "Swedish", "Turkish", "Ukrainian", "Welsh",
717
+ "emojis", "Gen Z slang", "how the stereotypical Karen would say it", "Klingon", "Neanderthal",
718
  "Pirate", "Strange Planet expospeak technical talk", "Yoda"],
719
  value=TRANSLATE_TO_DEFAULT)
720
 
 
732
 
733
  with gr.Tab("Lit style"):
734
  literary_style_radio = gr.Radio(label="Literary style:", choices=[
735
+ LITERARY_STYLE_DEFAULT, "Prose", "Story", "Summary", "Outline", "Bullets", "Poetry", "Haiku", "Limerick", "Rap",
736
+ "Joke", "Knock-knock", "FAQ"],
737
  value=LITERARY_STYLE_DEFAULT)
738
 
739
  literary_style_radio.change(update_foo,