Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -474,14 +474,14 @@ with gr.Blocks(css=STYLES) as demo:
|
|
| 474 |
with gr.Column():
|
| 475 |
gr.Markdown("For instant generation and concatenation, use `generate text` button. "
|
| 476 |
"Want to explore alternative choices? use `generate alternatives` button.")
|
| 477 |
-
|
| 478 |
with gr.Accordion("longer guideline", open=False):
|
| 479 |
-
gr.Markdown("`generate text` button generate continued text and attach it to the end. "
|
| 480 |
"on the other hand, `generate alternatives` button generate alternate texts "
|
| 481 |
"up to 3 and let you choose one of them. In both cases, **Write the next paragraph based on "
|
| 482 |
"the following stories so far.** is the default prompt. If you want to try your own designed "
|
| 483 |
"prompt, enter it in the textbox below.")
|
| 484 |
-
|
| 485 |
prompt = gr.Textbox(placeholder="design your own prompt", elem_classes=['no-label'])
|
| 486 |
|
| 487 |
with gr.Row():
|
|
@@ -511,24 +511,26 @@ with gr.Blocks(css=STYLES) as demo:
|
|
| 511 |
replace_type = gr.Dropdown(choices=['word', 'sentense', 'phrase', 'paragraph'], value='sentense', interactive=True, elem_classes=['no-label'])
|
| 512 |
|
| 513 |
with gr.Tab("Chatting"):
|
| 514 |
-
|
| 515 |
-
|
|
|
|
| 516 |
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
|
| 521 |
with gr.Tab("Exporting"):
|
| 522 |
-
gr.
|
| 523 |
-
|
| 524 |
-
|
| 525 |
-
|
| 526 |
-
|
| 527 |
-
|
| 528 |
-
|
| 529 |
-
|
| 530 |
-
|
| 531 |
-
|
|
|
|
| 532 |
|
| 533 |
progress_bar = gr.Textbox(elem_classes=['no-label'])
|
| 534 |
|
|
|
|
| 474 |
with gr.Column():
|
| 475 |
gr.Markdown("For instant generation and concatenation, use `generate text` button. "
|
| 476 |
"Want to explore alternative choices? use `generate alternatives` button.")
|
| 477 |
+
|
| 478 |
with gr.Accordion("longer guideline", open=False):
|
| 479 |
+
gr.Markdown("`generate text` button generate continued text and attach it to the end. "
|
| 480 |
"on the other hand, `generate alternatives` button generate alternate texts "
|
| 481 |
"up to 3 and let you choose one of them. In both cases, **Write the next paragraph based on "
|
| 482 |
"the following stories so far.** is the default prompt. If you want to try your own designed "
|
| 483 |
"prompt, enter it in the textbox below.")
|
| 484 |
+
|
| 485 |
prompt = gr.Textbox(placeholder="design your own prompt", elem_classes=['no-label'])
|
| 486 |
|
| 487 |
with gr.Row():
|
|
|
|
| 511 |
replace_type = gr.Dropdown(choices=['word', 'sentense', 'phrase', 'paragraph'], value='sentense', interactive=True, elem_classes=['no-label'])
|
| 512 |
|
| 513 |
with gr.Tab("Chatting"):
|
| 514 |
+
with gr.Column(elem_classes=['group-border']):
|
| 515 |
+
chatbot = gr.Chatbot([], elem_classes=['no-label-chatbot'])
|
| 516 |
+
chat_txt = gr.Textbox(placeholder="enter question", elem_classes=['no-label'])
|
| 517 |
|
| 518 |
+
with gr.Row():
|
| 519 |
+
clear_btn = gr.Button("clear", elem_classes=['control-label-font', 'control-button'])
|
| 520 |
+
regen_btn = gr.Button("regenerate", elem_classes=['control-label-font', 'control-button'])
|
| 521 |
|
| 522 |
with gr.Tab("Exporting"):
|
| 523 |
+
with gr.Column(elem_classes=['group-border']):
|
| 524 |
+
gr.Markdown("generate cover art with [`nota-ai/bk-sdm-base`](https://huggingface.co/nota-ai/bk-sdm-base) model. "
|
| 525 |
+
"design your own prompt in the textbox below, or just hit 'generate prompt for cover art` button. LLaMA2 "
|
| 526 |
+
"model will suggest a prompt for you based on your story.")
|
| 527 |
+
|
| 528 |
+
cover_art = gr.Image(interactive=False, elem_classes=['no-label-image'])
|
| 529 |
+
gen_cover_art_prompt = gr.Textbox(lines=5, max_lines=5, elem_classes=['no-label'])
|
| 530 |
+
# toggle between "generate prompt for cover art" and "generate cover art"
|
| 531 |
+
gen_cover_art_btn = gr.Button("generate prompt for cover art", elem_classes=['control-label-font', 'control-button'])
|
| 532 |
+
gen_pdf_btn = gr.Button("export as PDF", elem_classes=['control-label-font', 'control-button'])
|
| 533 |
+
pdf_file = gr.File(visible=False)
|
| 534 |
|
| 535 |
progress_bar = gr.Textbox(elem_classes=['no-label'])
|
| 536 |
|