Spaces:
Runtime error
Runtime error
yizhangliu
commited on
Commit
·
1f36d0f
1
Parent(s):
4928dcd
Update app.py
Browse files
app.py
CHANGED
@@ -19,15 +19,14 @@ def get_response_from_chatbot(text):
|
|
19 |
response = "Sorry, I'm am tired."
|
20 |
return response
|
21 |
|
22 |
-
def chat(message, chat_history):
|
23 |
out_chat = []
|
24 |
if chat_history != '':
|
25 |
out_chat = json.loads(chat_history)
|
26 |
-
# print(f'chat_1_{chat_history}')
|
27 |
response = get_response_from_chatbot(message)
|
28 |
out_chat.append((message, response))
|
29 |
chat_history = json.dumps(out_chat)
|
30 |
-
|
31 |
return out_chat, chat_history
|
32 |
|
33 |
start_work = """async() => {
|
@@ -81,9 +80,9 @@ start_work = """async() => {
|
|
81 |
window['chat_bot1'].children[1].textContent = '';
|
82 |
|
83 |
clientHeight = getClientHeight();
|
84 |
-
chat_row.style.height = (clientHeight-
|
85 |
-
window['chat_bot'].style.height = (clientHeight-
|
86 |
-
window['chat_bot1'].style.height = (clientHeight-
|
87 |
window['checkChange'] = function checkChange() {
|
88 |
try {
|
89 |
if (window['chat_bot'].children[2].children[0].children.length > window['div_count']) {
|
|
|
19 |
response = "Sorry, I'm am tired."
|
20 |
return response
|
21 |
|
22 |
+
def chat(message, chat_history):
|
23 |
out_chat = []
|
24 |
if chat_history != '':
|
25 |
out_chat = json.loads(chat_history)
|
|
|
26 |
response = get_response_from_chatbot(message)
|
27 |
out_chat.append((message, response))
|
28 |
chat_history = json.dumps(out_chat)
|
29 |
+
logger.info(f"out_chat_: {len(out_chat)}")
|
30 |
return out_chat, chat_history
|
31 |
|
32 |
start_work = """async() => {
|
|
|
80 |
window['chat_bot1'].children[1].textContent = '';
|
81 |
|
82 |
clientHeight = getClientHeight();
|
83 |
+
chat_row.style.height = (clientHeight-150) + 'px';
|
84 |
+
window['chat_bot'].style.height = (clientHeight-150) + 'px';
|
85 |
+
window['chat_bot1'].style.height = (clientHeight-150) + 'px';
|
86 |
window['checkChange'] = function checkChange() {
|
87 |
try {
|
88 |
if (window['chat_bot'].children[2].children[0].children.length > window['div_count']) {
|