Add Express-inator
Browse files
app.py
CHANGED
|
@@ -382,14 +382,14 @@ with gr.Blocks(css=".gradio-container {background-color: lightgray}") as block:
|
|
| 382 |
|
| 383 |
with gr.Row():
|
| 384 |
with gr.Column():
|
| 385 |
-
with gr.Accordion("Tools", open=
|
| 386 |
tools_cb_group = gr.CheckboxGroup(label="Tools:", choices=TOOLS_LIST,
|
| 387 |
value=TOOLS_DEFAULT_LIST)
|
| 388 |
tools_cb_group.change(update_selected_tools,
|
| 389 |
inputs=[tools_cb_group, tools_list_state, llm_state],
|
| 390 |
outputs=[tools_list_state, llm_state, chain_state, express_chain_state])
|
| 391 |
|
| 392 |
-
with gr.Accordion("Formality", open=
|
| 393 |
formality_radio = gr.Radio(label="Formality:",
|
| 394 |
choices=[FORMALITY_DEFAULT, "Casual", "Polite", "Honorific"],
|
| 395 |
value=FORMALITY_DEFAULT)
|
|
@@ -397,7 +397,7 @@ with gr.Blocks(css=".gradio-container {background-color: lightgray}") as block:
|
|
| 397 |
inputs=[formality_radio, formality_state],
|
| 398 |
outputs=[formality_state])
|
| 399 |
|
| 400 |
-
with gr.Accordion("Translate to", open=
|
| 401 |
translate_to_radio = gr.Radio(label="Translate to:", choices=[
|
| 402 |
TRANSLATE_TO_DEFAULT, "Arabic", "British English", "Chinese (Simplified)", "Chinese (Traditional)",
|
| 403 |
"Czech", "Danish", "Dutch", "English", "Finnish", "French", "German",
|
|
@@ -413,15 +413,8 @@ with gr.Blocks(css=".gradio-container {background-color: lightgray}") as block:
|
|
| 413 |
inputs=[translate_to_radio, translate_to_state],
|
| 414 |
outputs=[translate_to_state])
|
| 415 |
|
| 416 |
-
with gr.Accordion("Max words", open=True):
|
| 417 |
-
num_words_slider = gr.Slider(label="Max number of words to generate (0 for don't care)",
|
| 418 |
-
value=NUM_WORDS_DEFAULT, minimum=0, maximum=100, step=10)
|
| 419 |
-
num_words_slider.change(update_foo,
|
| 420 |
-
inputs=[num_words_slider, num_words_state],
|
| 421 |
-
outputs=[num_words_state])
|
| 422 |
-
|
| 423 |
with gr.Column():
|
| 424 |
-
with gr.Accordion("Literary style", open=
|
| 425 |
literary_style_radio = gr.Radio(label="Literary style:", choices=[
|
| 426 |
LITERARY_STYLE_DEFAULT, "Poetry", "Haiku", "Limerick", "Joke", "Knock-knock"],
|
| 427 |
value=LITERARY_STYLE_DEFAULT)
|
|
@@ -430,7 +423,7 @@ with gr.Blocks(css=".gradio-container {background-color: lightgray}") as block:
|
|
| 430 |
inputs=[literary_style_radio, literary_style_state],
|
| 431 |
outputs=[literary_style_state])
|
| 432 |
|
| 433 |
-
with gr.Accordion("Emotions", open=
|
| 434 |
anticipation_level_radio = gr.Radio(label="Anticipation level:",
|
| 435 |
choices=[EMOTION_DEFAULT, "Interest", "Anticipation", "Vigilance"],
|
| 436 |
value=EMOTION_DEFAULT)
|
|
@@ -487,6 +480,13 @@ with gr.Blocks(css=".gradio-container {background-color: lightgray}") as block:
|
|
| 487 |
inputs=[anger_level_radio, anger_level_state],
|
| 488 |
outputs=[anger_level_state])
|
| 489 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 490 |
gr.Examples(
|
| 491 |
examples=["How many people live in Canada?",
|
| 492 |
"What is 2 to the 30th power?",
|
|
|
|
| 382 |
|
| 383 |
with gr.Row():
|
| 384 |
with gr.Column():
|
| 385 |
+
with gr.Accordion("Tools", open=False):
|
| 386 |
tools_cb_group = gr.CheckboxGroup(label="Tools:", choices=TOOLS_LIST,
|
| 387 |
value=TOOLS_DEFAULT_LIST)
|
| 388 |
tools_cb_group.change(update_selected_tools,
|
| 389 |
inputs=[tools_cb_group, tools_list_state, llm_state],
|
| 390 |
outputs=[tools_list_state, llm_state, chain_state, express_chain_state])
|
| 391 |
|
| 392 |
+
with gr.Accordion("Formality", open=False):
|
| 393 |
formality_radio = gr.Radio(label="Formality:",
|
| 394 |
choices=[FORMALITY_DEFAULT, "Casual", "Polite", "Honorific"],
|
| 395 |
value=FORMALITY_DEFAULT)
|
|
|
|
| 397 |
inputs=[formality_radio, formality_state],
|
| 398 |
outputs=[formality_state])
|
| 399 |
|
| 400 |
+
with gr.Accordion("Translate to", open=False):
|
| 401 |
translate_to_radio = gr.Radio(label="Translate to:", choices=[
|
| 402 |
TRANSLATE_TO_DEFAULT, "Arabic", "British English", "Chinese (Simplified)", "Chinese (Traditional)",
|
| 403 |
"Czech", "Danish", "Dutch", "English", "Finnish", "French", "German",
|
|
|
|
| 413 |
inputs=[translate_to_radio, translate_to_state],
|
| 414 |
outputs=[translate_to_state])
|
| 415 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 416 |
with gr.Column():
|
| 417 |
+
with gr.Accordion("Literary style", open=False):
|
| 418 |
literary_style_radio = gr.Radio(label="Literary style:", choices=[
|
| 419 |
LITERARY_STYLE_DEFAULT, "Poetry", "Haiku", "Limerick", "Joke", "Knock-knock"],
|
| 420 |
value=LITERARY_STYLE_DEFAULT)
|
|
|
|
| 423 |
inputs=[literary_style_radio, literary_style_state],
|
| 424 |
outputs=[literary_style_state])
|
| 425 |
|
| 426 |
+
with gr.Accordion("Emotions", open=False):
|
| 427 |
anticipation_level_radio = gr.Radio(label="Anticipation level:",
|
| 428 |
choices=[EMOTION_DEFAULT, "Interest", "Anticipation", "Vigilance"],
|
| 429 |
value=EMOTION_DEFAULT)
|
|
|
|
| 480 |
inputs=[anger_level_radio, anger_level_state],
|
| 481 |
outputs=[anger_level_state])
|
| 482 |
|
| 483 |
+
with gr.Accordion("Max words", open=False):
|
| 484 |
+
num_words_slider = gr.Slider(label="Max number of words to generate (0 for don't care)",
|
| 485 |
+
value=NUM_WORDS_DEFAULT, minimum=0, maximum=100, step=10)
|
| 486 |
+
num_words_slider.change(update_foo,
|
| 487 |
+
inputs=[num_words_slider, num_words_state],
|
| 488 |
+
outputs=[num_words_state])
|
| 489 |
+
|
| 490 |
gr.Examples(
|
| 491 |
examples=["How many people live in Canada?",
|
| 492 |
"What is 2 to the 30th power?",
|