0.1.106
This commit is contained in:
parent
e79efc284f
commit
c91c34f76b
@ -1,7 +1,7 @@
|
||||
[metadata]
|
||||
# replace with your username:
|
||||
name = guan
|
||||
version = 0.1.105
|
||||
version = 0.1.106
|
||||
author = guanjihuan
|
||||
author_email = guanjihuan@163.com
|
||||
description = An open source python package
|
||||
|
@ -1,6 +1,6 @@
|
||||
Metadata-Version: 2.1
|
||||
Name: guan
|
||||
Version: 0.1.105
|
||||
Version: 0.1.106
|
||||
Summary: An open source python package
|
||||
Home-page: https://py.guanjihuan.com
|
||||
Author: guanjihuan
|
||||
|
@ -22,16 +22,17 @@ def chat(prompt='你好', model=1, stream=0, top_p=0.8, temperature=0.85):
|
||||
while True:
|
||||
try:
|
||||
data = client_socket.recv(1024)
|
||||
response_data = data.decode()
|
||||
response_dict = json.loads(response_data)
|
||||
stream_response = response_dict['stream_response']
|
||||
response = response_dict['response']
|
||||
end_message = response_dict['end_message']
|
||||
if end_message == 1:
|
||||
break
|
||||
else:
|
||||
if stream == 1:
|
||||
print(stream_response)
|
||||
if data != b'':
|
||||
response_data = data.decode()
|
||||
response_dict = json.loads(response_data)
|
||||
stream_response = response_dict['stream_response']
|
||||
response += stream_response
|
||||
end_message = response_dict['end_message']
|
||||
if end_message == 1:
|
||||
break
|
||||
else:
|
||||
if stream == 1:
|
||||
print(stream_response)
|
||||
except:
|
||||
break
|
||||
client_socket.close()
|
||||
|
Loading…
x
Reference in New Issue
Block a user