Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,6 +11,7 @@ def ai_article_generator(
|
|
11 |
topic, type, length
|
12 |
):
|
13 |
prompt = f"Write a {type} about the topic in about {length} words: {topic}"
|
|
|
14 |
ai_text = generate(f"Write an article about the topic: {text}")
|
15 |
ai_text = ai_text.choices[0].message.content
|
16 |
return ai_text
|
@@ -69,13 +70,14 @@ with gr.Blocks() as demo:
|
|
69 |
gr.Markdown("## Enter a topic to write an article about:")
|
70 |
input_topic = gr.Textbox(label="Topic")
|
71 |
with gr.Row():
|
72 |
-
gr.
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
|
|
79 |
ai_article_btn = gr.Button("Generate", visible=True)
|
80 |
ai_generated = gr.Markdown("### Generated article:", visible=False)
|
81 |
ai_label = gr.HTML(label="AI", visible=False)
|
|
|
11 |
topic, type, length
|
12 |
):
|
13 |
prompt = f"Write a {type} about the topic in about {length} words: {topic}"
|
14 |
+
print(prompt)
|
15 |
ai_text = generate(f"Write an article about the topic: {text}")
|
16 |
ai_text = ai_text.choices[0].message.content
|
17 |
return ai_text
|
|
|
70 |
gr.Markdown("## Enter a topic to write an article about:")
|
71 |
input_topic = gr.Textbox(label="Topic")
|
72 |
with gr.Row():
|
73 |
+
with gr.Column():
|
74 |
+
input_type = gr.Dropdown(
|
75 |
+
choices = ['article', 'essay', 'blog', 'report', 'letter'],
|
76 |
+
value = 'article',
|
77 |
+
label="Choose type of text:"
|
78 |
+
)
|
79 |
+
with gr.Column():
|
80 |
+
input_length = gr.Number(value=200, label="Choose length of the text:")
|
81 |
ai_article_btn = gr.Button("Generate", visible=True)
|
82 |
ai_generated = gr.Markdown("### Generated article:", visible=False)
|
83 |
ai_label = gr.HTML(label="AI", visible=False)
|