Spaces:
Runtime error
Runtime error
aliasgerovs
commited on
Merge branch 'main' of https://huggingface.co/spaces/polygraf-ai/article_writer
Browse files
app.py
CHANGED
@@ -523,6 +523,33 @@ def create_interface():
|
|
523 |
|
524 |
generate_btn = gr.Button("Generate Article", variant="primary")
|
525 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
526 |
with gr.Column(scale=3):
|
527 |
output_article = gr.Textbox(label="Generated Article", lines=20)
|
528 |
ai_comments = gr.Textbox(
|
@@ -536,8 +563,7 @@ def create_interface():
|
|
536 |
)
|
537 |
ai_check_btn = gr.Button("AI Check")
|
538 |
ai_check_result = gr.Label(label="AI Check Result")
|
539 |
-
|
540 |
-
highlighted_text = gr.HTML(label="Sentence Breakdown", visible=False)
|
541 |
humanize_btn = gr.Button("Humanize")
|
542 |
# humanized_output = gr.Textbox(label="Humanized Article", lines=20, elem_classes=["custom-textbox"])
|
543 |
humanized_output = gr.Markdown(label="Humanized Article", value="\n\n\n\n", render=True)
|
@@ -559,31 +585,6 @@ def create_interface():
|
|
559 |
output_article.change(become_visible, inputs=output_article, outputs=ai_comments)
|
560 |
ai_comments.change(become_visible, inputs=output_article, outputs=regenerate_btn)
|
561 |
|
562 |
-
with gr.Accordion("Advanced Humanizer Settings", open=False):
|
563 |
-
with gr.Row():
|
564 |
-
model_dropdown = gr.Radio(
|
565 |
-
choices=[
|
566 |
-
"Base Model",
|
567 |
-
"Large Model",
|
568 |
-
"XL Model",
|
569 |
-
# "XL Law Model",
|
570 |
-
# "XL Marketing Model",
|
571 |
-
# "XL Child Style Model",
|
572 |
-
],
|
573 |
-
value="Large Model",
|
574 |
-
label="Humanizer Model Version",
|
575 |
-
)
|
576 |
-
with gr.Row():
|
577 |
-
temperature_slider = gr.Slider(minimum=0.5, maximum=2.0, step=0.1, value=1.2, label="Temperature")
|
578 |
-
top_k_slider = gr.Slider(minimum=0, maximum=300, step=25, value=50, label="Top k")
|
579 |
-
with gr.Row():
|
580 |
-
repetition_penalty_slider = gr.Slider(
|
581 |
-
minimum=1.0, maximum=2.0, step=0.1, value=1, label="Repetition Penalty"
|
582 |
-
)
|
583 |
-
length_penalty_slider = gr.Slider(
|
584 |
-
minimum=0.0, maximum=2.0, step=0.1, value=1.0, label="Length Penalty"
|
585 |
-
)
|
586 |
-
|
587 |
generate_btn.click(
|
588 |
fn=generate_and_format,
|
589 |
inputs=[
|
|
|
523 |
|
524 |
generate_btn = gr.Button("Generate Article", variant="primary")
|
525 |
|
526 |
+
with gr.Accordion("Advanced Humanizer Settings", open=True):
|
527 |
+
with gr.Row():
|
528 |
+
model_dropdown = gr.Radio(
|
529 |
+
choices=[
|
530 |
+
"Base Model",
|
531 |
+
"Large Model",
|
532 |
+
"XL Model",
|
533 |
+
# "XL Law Model",
|
534 |
+
# "XL Marketing Model",
|
535 |
+
# "XL Child Style Model",
|
536 |
+
],
|
537 |
+
value="Large Model",
|
538 |
+
label="Humanizer Model Version",
|
539 |
+
)
|
540 |
+
with gr.Row():
|
541 |
+
temperature_slider = gr.Slider(
|
542 |
+
minimum=0.5, maximum=2.0, step=0.1, value=1.2, label="Temperature"
|
543 |
+
)
|
544 |
+
top_k_slider = gr.Slider(minimum=0, maximum=300, step=25, value=50, label="Top k")
|
545 |
+
with gr.Row():
|
546 |
+
repetition_penalty_slider = gr.Slider(
|
547 |
+
minimum=1.0, maximum=2.0, step=0.1, value=1, label="Repetition Penalty"
|
548 |
+
)
|
549 |
+
length_penalty_slider = gr.Slider(
|
550 |
+
minimum=0.0, maximum=2.0, step=0.1, value=1.0, label="Length Penalty"
|
551 |
+
)
|
552 |
+
|
553 |
with gr.Column(scale=3):
|
554 |
output_article = gr.Textbox(label="Generated Article", lines=20)
|
555 |
ai_comments = gr.Textbox(
|
|
|
563 |
)
|
564 |
ai_check_btn = gr.Button("AI Check")
|
565 |
ai_check_result = gr.Label(label="AI Check Result")
|
566 |
+
highlighted_text = gr.HTML(label="Sentence Breakdown", visible=False)
|
|
|
567 |
humanize_btn = gr.Button("Humanize")
|
568 |
# humanized_output = gr.Textbox(label="Humanized Article", lines=20, elem_classes=["custom-textbox"])
|
569 |
humanized_output = gr.Markdown(label="Humanized Article", value="\n\n\n\n", render=True)
|
|
|
585 |
output_article.change(become_visible, inputs=output_article, outputs=ai_comments)
|
586 |
ai_comments.change(become_visible, inputs=output_article, outputs=regenerate_btn)
|
587 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
588 |
generate_btn.click(
|
589 |
fn=generate_and_format,
|
590 |
inputs=[
|