Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -348,7 +348,7 @@ with gr.Blocks(css=STYLES) as demo:
|
|
348 |
"This application built on [Gradio](https://www.gradio.app), and the underlying text generation is powered by [Hugging Face Inference API](https://huggingface.co/inference-api). The text generation model might"
|
349 |
"be changed over time, but [meta-llama/Llama-2-70b-chat-hf](https://huggingface.co/meta-llama/Llama-2-70b-chat-hf) is selected for now.",
|
350 |
elem_classes=['center', 'small-big'])
|
351 |
-
|
352 |
with gr.Row():
|
353 |
with gr.Column(scale=2):
|
354 |
editor = gr.Textbox(lines=32, max_lines=32, elem_classes=['no-label', 'small-big-textarea'])
|
@@ -359,25 +359,25 @@ with gr.Blocks(css=STYLES) as demo:
|
|
359 |
with gr.Column(elem_classes=['group-border']):
|
360 |
with gr.Column():
|
361 |
gr.Markdown("`generate text` button generate continued text and attach it to the end. on the other hand, `generate alternatives` button generate alternate texts up to 3 and let you choose one of them.")
|
362 |
-
|
363 |
with gr.Row():
|
364 |
gen_btn = gr.Button("generate text", elem_classes=['control-label-font', 'control-button'])
|
365 |
gen_alt_btn = gr.Button("generate alternatives", elem_classes=['control-label-font', 'control-button'])
|
366 |
|
367 |
with gr.Column():
|
368 |
-
with gr.Row(visible=False) as first_alt:
|
369 |
gr.Markdown("↳", scale=1, elem_classes=['wrap'])
|
370 |
alt_btn1 = gr.Button("Alternative 1", elem_classes=['alt-button'], scale=5)
|
371 |
|
372 |
-
with gr.Row(visible=False) as second_alt:
|
373 |
gr.Markdown("↳", scale=1, elem_classes=['wrap'])
|
374 |
alt_btn2 = gr.Button("Alternative 2", elem_classes=['alt-button'], scale=5)
|
375 |
|
376 |
-
with gr.Row(visible=False) as third_alt:
|
377 |
gr.Markdown("↳", scale=1, elem_classes=['wrap'])
|
378 |
alt_btn3 = gr.Button("Alternative 3", elem_classes=['alt-button'], scale=5)
|
379 |
|
380 |
-
with gr.Row(elem_classes=['']):
|
381 |
with gr.Column():
|
382 |
gr.Markdown("'Write the next paragraph based on the following stories so far.' is the default prompt when clicking `generate text`, and the text so far will always be attached to the end. By giving your own prompt, only the default prompt will be replaced.")
|
383 |
|
|
|
348 |
"This application built on [Gradio](https://www.gradio.app), and the underlying text generation is powered by [Hugging Face Inference API](https://huggingface.co/inference-api). The text generation model might"
|
349 |
"be changed over time, but [meta-llama/Llama-2-70b-chat-hf](https://huggingface.co/meta-llama/Llama-2-70b-chat-hf) is selected for now.",
|
350 |
elem_classes=['center', 'small-big'])
|
351 |
+
|
352 |
with gr.Row():
|
353 |
with gr.Column(scale=2):
|
354 |
editor = gr.Textbox(lines=32, max_lines=32, elem_classes=['no-label', 'small-big-textarea'])
|
|
|
359 |
with gr.Column(elem_classes=['group-border']):
|
360 |
with gr.Column():
|
361 |
gr.Markdown("`generate text` button generate continued text and attach it to the end. on the other hand, `generate alternatives` button generate alternate texts up to 3 and let you choose one of them.")
|
362 |
+
|
363 |
with gr.Row():
|
364 |
gen_btn = gr.Button("generate text", elem_classes=['control-label-font', 'control-button'])
|
365 |
gen_alt_btn = gr.Button("generate alternatives", elem_classes=['control-label-font', 'control-button'])
|
366 |
|
367 |
with gr.Column():
|
368 |
+
with gr.Row(visible=False) as first_alt:
|
369 |
gr.Markdown("↳", scale=1, elem_classes=['wrap'])
|
370 |
alt_btn1 = gr.Button("Alternative 1", elem_classes=['alt-button'], scale=5)
|
371 |
|
372 |
+
with gr.Row(visible=False) as second_alt:
|
373 |
gr.Markdown("↳", scale=1, elem_classes=['wrap'])
|
374 |
alt_btn2 = gr.Button("Alternative 2", elem_classes=['alt-button'], scale=5)
|
375 |
|
376 |
+
with gr.Row(visible=False) as third_alt:
|
377 |
gr.Markdown("↳", scale=1, elem_classes=['wrap'])
|
378 |
alt_btn3 = gr.Button("Alternative 3", elem_classes=['alt-button'], scale=5)
|
379 |
|
380 |
+
with gr.Row(elem_classes=['group-border']):
|
381 |
with gr.Column():
|
382 |
gr.Markdown("'Write the next paragraph based on the following stories so far.' is the default prompt when clicking `generate text`, and the text so far will always be attached to the end. By giving your own prompt, only the default prompt will be replaced.")
|
383 |
|