Spaces:
Runtime error
Runtime error
Commit
·
29bf882
1
Parent(s):
6639c18
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,7 +38,7 @@ def respond(message, chat_history):
|
|
| 38 |
qa = ConversationalRetrievalChain.from_llm(model, retriever)
|
| 39 |
|
| 40 |
bot_message = qa({"question": message, "chat_history": chat_history})
|
| 41 |
-
chat_history
|
| 42 |
time.sleep(1)
|
| 43 |
return "", chat_history
|
| 44 |
|
|
@@ -56,6 +56,7 @@ with gr.Blocks() as demo:
|
|
| 56 |
api_check_button = gr.Button("Get API Key")
|
| 57 |
api_print = gr.Textbox(label = "OpenAI API Key - Please ensure the API Key is set correctly")
|
| 58 |
chatbot = gr.Chatbot(label="ChatGPT Powered Coding Assistant")
|
|
|
|
| 59 |
msg = gr.Textbox(label="User Prompt", placeholder="Your Query Here")
|
| 60 |
clear = gr.Button("Clear")
|
| 61 |
|
|
|
|
| 38 |
qa = ConversationalRetrievalChain.from_llm(model, retriever)
|
| 39 |
|
| 40 |
bot_message = qa({"question": message, "chat_history": chat_history})
|
| 41 |
+
chat_history = [(message, bot_message["answer"])]
|
| 42 |
time.sleep(1)
|
| 43 |
return "", chat_history
|
| 44 |
|
|
|
|
| 56 |
api_check_button = gr.Button("Get API Key")
|
| 57 |
api_print = gr.Textbox(label = "OpenAI API Key - Please ensure the API Key is set correctly")
|
| 58 |
chatbot = gr.Chatbot(label="ChatGPT Powered Coding Assistant")
|
| 59 |
+
chat_history = []
|
| 60 |
msg = gr.Textbox(label="User Prompt", placeholder="Your Query Here")
|
| 61 |
clear = gr.Button("Clear")
|
| 62 |
|