import gradio as gr
from revChatGPT.V1 import Chatbot
email = None
password = None
access_token = None
session_token = None
def configure_chatbot(email, password):
config = {}
if password:
config.update({"email": email,
"password": password})
global chatbot
chatbot = Chatbot(config=config)
def ask_bot(prompt):
message = ""
for data in chatbot.ask(prompt):
message = data["message"]
message = message.replace("\n", "
")
return message
def chatgpt_clone(inputs, history):
history = history or []
output = ask_bot(inputs)
history.append((inputs, output))
return history, history
with gr.Blocks() as demo:
gr.Markdown("""