Upload WarServer.py
Browse filesUpdated the Server part
- WarServer.py +6 -2
WarServer.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import socket
|
2 |
import WarBot
|
3 |
|
@@ -21,8 +22,11 @@ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as server_socket:
|
|
21 |
received_string = data.decode()
|
22 |
print(f'Received string from client: {received_string}')
|
23 |
|
24 |
-
response =
|
|
|
|
|
|
|
25 |
response_string = response
|
26 |
|
27 |
conn.sendall(response_string.encode())
|
28 |
-
conn.close()
|
|
|
1 |
+
# WarServer - replace HOST with 'localhost' for local testing
|
2 |
import socket
|
3 |
import WarBot
|
4 |
|
|
|
22 |
received_string = data.decode()
|
23 |
print(f'Received string from client: {received_string}')
|
24 |
|
25 |
+
response = ""
|
26 |
+
while not response:
|
27 |
+
response = WarBot.get_response(quote, model, tokenizer, model_punct, temperature=0.2)
|
28 |
+
|
29 |
response_string = response
|
30 |
|
31 |
conn.sendall(response_string.encode())
|
32 |
+
conn.close()
|