Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -8,9 +8,9 @@ def on_first_button_click():
|
|
8 |
return gr.update(visible=True)
|
9 |
|
10 |
def ai_article_generator(
|
11 |
-
|
12 |
):
|
13 |
-
prompt = f"Write a {
|
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
|
@@ -137,7 +137,9 @@ with gr.Blocks() as demo:
|
|
137 |
ai_article_btn.click(
|
138 |
fn=ai_article_generator,
|
139 |
inputs=[
|
140 |
-
|
|
|
|
|
141 |
],
|
142 |
outputs=[ai_label],
|
143 |
)
|
|
|
8 |
return gr.update(visible=True)
|
9 |
|
10 |
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
|
|
|
137 |
ai_article_btn.click(
|
138 |
fn=ai_article_generator,
|
139 |
inputs=[
|
140 |
+
input_topic,
|
141 |
+
input_type,
|
142 |
+
input_length
|
143 |
],
|
144 |
outputs=[ai_label],
|
145 |
)
|