dotmet commited on
Commit
d335b54
·
1 Parent(s): 74ef55f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py CHANGED
@@ -3,9 +3,14 @@ from revChatGPT.V1 import Chatbot
3
 
4
  #You can setup login information here, or login in from UI
5
 
 
6
  email = None
7
  password = None
 
 
8
  access_token = None
 
 
9
  session_token = None
10
 
11
  def configure_chatbot(method, info):
@@ -69,6 +74,17 @@ with gr.Blocks() as demo:
69
  with gr.Row():
70
  login = gr.Button("Login")
71
  login.click(configure_chatbot, inputs=[method, info])
 
 
 
 
 
 
 
 
 
 
 
72
 
73
  gr.Markdown("""<h2>Start Chatting ...</h2>""")
74
  chatbot1 = gr.Chatbot()
 
3
 
4
  #You can setup login information here, or login in from UI
5
 
6
+ # If you want to use Email/Password to login, put your account information here
7
  email = None
8
  password = None
9
+
10
+ # If you have an access token, replace the None with your token
11
  access_token = None
12
+
13
+ # If you have a session token, put your session token here
14
  session_token = None
15
 
16
  def configure_chatbot(method, info):
 
74
  with gr.Row():
75
  login = gr.Button("Login")
76
  login.click(configure_chatbot, inputs=[method, info])
77
+ else:
78
+ if email and password:
79
+ method = "Email/Password"
80
+ info = email + " " + password
81
+ elif access_token:
82
+ method = "Access token"
83
+ info = access_token
84
+ elif session_token:
85
+ method = "Session token"
86
+ info = session_token
87
+ configure_chatbot(method, info)
88
 
89
  gr.Markdown("""<h2>Start Chatting ...</h2>""")
90
  chatbot1 = gr.Chatbot()