File size: 1,447 Bytes
e31d3f6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""
main module blog generator.
"""
import gradio as gr
from module.generator import (generate_blog)
######################  Front-end ########################
with gr.Blocks(theme = gr.themes.Monochrome()) as demo:
    gr.Markdown("""
    <h1><center>Writer.ai</center></h1>
    <h3><center>Blog and essay writer ai tool</center></h3>
    """)
    with gr.Column():
        output_block = gr.Markdown(line_breaks = True)
    with gr.Row():
        topic = gr.Text(label = "Topic",
                        placeholder = "essay or blog topic")
        content_type = gr.Text(label = "Type",
                               placeholder = "essay, blog post")
        tone = gr.Text(label = "Tone",
                       placeholder = "soft, professional")
        link = gr.Text(label = "link",
                       placeholder = "links with comma seperated")
        length = gr.Text(label = "Length",
                         placeholder = "length of generated contents")
    with gr.Row():
        stop_button = gr.Button("Stop")
        resume_button = gr.Button("Resume")
        start_button = gr.Button("Start")
    start_button.click(fn = generate_blog, inputs = [topic,
                                                     content_type, link,
                                                     tone, length],
                                                     outputs = output_block)
demo.queue(max_size = 1)
demo.launch(debug = True)