minko186 commited on
Commit
e9640b0
·
verified ·
1 Parent(s): 04c7deb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
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.Markdown("## Choose type of text:")
73
- input_type = gr.Dropdown(
74
- choices = ['article', 'essay', 'blog', 'report', 'letter'],
75
- value = 'article'
76
- )
77
- gr.Markdown("## Enter length of the text:")
78
- input_length = gr.Number(value=200)
 
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)