Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -14,6 +14,7 @@ modelPath = 'nlp-model.json'
|
|
14 |
|
15 |
inputs = []
|
16 |
client_ports = []
|
|
|
17 |
|
18 |
layout = [
|
19 |
[sg.Multiline(size=(200, 10), key='-CLIENT-')],
|
@@ -113,7 +114,6 @@ async def handleWebSocket(ws):
|
|
113 |
while True:
|
114 |
message = await ws.recv()
|
115 |
print(message)
|
116 |
-
client_messages.append(message)
|
117 |
timestamp = datetime.datetime.now().isoformat()
|
118 |
sender = 'client'
|
119 |
db = sqlite3.connect('chat-hub.db')
|
@@ -124,7 +124,6 @@ async def handleWebSocket(ws):
|
|
124 |
response = await askQuestion(message)
|
125 |
serverResponse = f'server response:{response}'
|
126 |
# Append the server response to the server_responses list
|
127 |
-
server_responses.append(serverResponse)
|
128 |
timestamp = datetime.datetime.now().isoformat()
|
129 |
serverSender = 'server'
|
130 |
db.execute('INSERT INTO messages (sender, message, timestamp) VALUES (?, ?, ?)',
|
|
|
14 |
|
15 |
inputs = []
|
16 |
client_ports = []
|
17 |
+
server_ports = []
|
18 |
|
19 |
layout = [
|
20 |
[sg.Multiline(size=(200, 10), key='-CLIENT-')],
|
|
|
114 |
while True:
|
115 |
message = await ws.recv()
|
116 |
print(message)
|
|
|
117 |
timestamp = datetime.datetime.now().isoformat()
|
118 |
sender = 'client'
|
119 |
db = sqlite3.connect('chat-hub.db')
|
|
|
124 |
response = await askQuestion(message)
|
125 |
serverResponse = f'server response:{response}'
|
126 |
# Append the server response to the server_responses list
|
|
|
127 |
timestamp = datetime.datetime.now().isoformat()
|
128 |
serverSender = 'server'
|
129 |
db.execute('INSERT INTO messages (sender, message, timestamp) VALUES (?, ?, ?)',
|