ShiwenNi commited on
Commit
d3b3756
1 Parent(s): cd35ac5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -3,6 +3,7 @@ import gradio as gr
3
  import openai
4
 
5
  def gpt(api_key):
 
6
  completion = openai.ChatCompletion.create(
7
  model="gpt-3.5-turbo",
8
  messages=[{"role": "user", "content": "Generate a fake news story"}]
 
3
  import openai
4
 
5
  def gpt(api_key):
6
+ openai.api_key = api_key
7
  completion = openai.ChatCompletion.create(
8
  model="gpt-3.5-turbo",
9
  messages=[{"role": "user", "content": "Generate a fake news story"}]