Update app.py
Browse files
app.py
CHANGED
@@ -6,10 +6,10 @@ password = None
|
|
6 |
access_token = None
|
7 |
session_token = None
|
8 |
|
9 |
-
def configure_chatbot(
|
10 |
config = {}
|
11 |
-
config.update({"email":
|
12 |
-
"password":
|
13 |
|
14 |
global chatbot
|
15 |
chatbot = Chatbot(config=config)
|
@@ -36,12 +36,12 @@ with gr.Blocks() as demo:
|
|
36 |
|
37 |
gr.Markdown("""<h2>Login to OpenAI</h2>""")
|
38 |
with gr.Row():
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
login = gr.Button("输完箱密点此登录")
|
44 |
-
|
45 |
|
46 |
gr.Markdown("""<h2>开始聊吧 ...</h2>""")
|
47 |
chatbot1 = gr.Chatbot()
|
|
|
6 |
access_token = None
|
7 |
session_token = None
|
8 |
|
9 |
+
def configure_chatbot(email,password):
|
10 |
config = {}
|
11 |
+
config.update({"email": email,
|
12 |
+
"password": password})
|
13 |
|
14 |
global chatbot
|
15 |
chatbot = Chatbot(config=config)
|
|
|
36 |
|
37 |
gr.Markdown("""<h2>Login to OpenAI</h2>""")
|
38 |
with gr.Row():
|
39 |
+
email = gr.Textbox(placeholder="请输入已经注册了openAI的邮箱地址")
|
40 |
+
with gr.Row():
|
41 |
+
password = gr.Textbox(placeholder="请输入openAI的登录密码")
|
42 |
+
with gr.Row():
|
43 |
login = gr.Button("输完箱密点此登录")
|
44 |
+
login.click(configure_chatbot, inputs=[email,password])
|
45 |
|
46 |
gr.Markdown("""<h2>开始聊吧 ...</h2>""")
|
47 |
chatbot1 = gr.Chatbot()
|