Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,6 @@ import openai
|
|
5 |
import gradio as gr
|
6 |
import random
|
7 |
|
8 |
-
openai.api_key = ''
|
9 |
|
10 |
user_contexts = {}
|
11 |
|
@@ -29,8 +28,7 @@ def generate_image_url(prompt):
|
|
29 |
image_url = response["data"][0]["url"]
|
30 |
return image_url
|
31 |
|
32 |
-
def greet(user_id,
|
33 |
-
globals openai.api_key
|
34 |
openai.api_key = api_key
|
35 |
global user_contexts
|
36 |
if user_id not in user_contexts:
|
|
|
5 |
import gradio as gr
|
6 |
import random
|
7 |
|
|
|
8 |
|
9 |
user_contexts = {}
|
10 |
|
|
|
28 |
image_url = response["data"][0]["url"]
|
29 |
return image_url
|
30 |
|
31 |
+
def greet(user_id, api_key, user_question, clear_history):
|
|
|
32 |
openai.api_key = api_key
|
33 |
global user_contexts
|
34 |
if user_id not in user_contexts:
|