minko186 commited on
Commit
eb115c6
·
verified ·
1 Parent(s): 5c509dc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -8,11 +8,11 @@ def on_first_button_click():
8
  return gr.update(visible=True)
9
 
10
  def ai_article_generator(
11
- topic, text_type, length, ai_model
12
  ):
13
  prompt = f"Write a {text_type} about the topic in about {length} words: {topic}"
14
  print(prompt)
15
- ai_text = generate(f"Write an article about the topic: {text}", ai_model)
16
  ai_text = ai_text.choices[0].message.content
17
  return ai_text
18
 
@@ -156,7 +156,8 @@ with gr.Blocks() as demo:
156
  input_topic,
157
  input_text_type,
158
  input_length,
159
- ai_generator
 
160
  ],
161
  outputs=[ai_label],
162
  )
 
8
  return gr.update(visible=True)
9
 
10
  def ai_article_generator(
11
+ topic, text_type, length, ai_model, api = None
12
  ):
13
  prompt = f"Write a {text_type} about the topic in about {length} words: {topic}"
14
  print(prompt)
15
+ ai_text = generate(f"Write an article about the topic: {text}", ai_model, api)
16
  ai_text = ai_text.choices[0].message.content
17
  return ai_text
18
 
 
156
  input_topic,
157
  input_text_type,
158
  input_length,
159
+ ai_generator,
160
+ input_api
161
  ],
162
  outputs=[ai_label],
163
  )