0.1.131
This commit is contained in:
parent
39665bf0cb
commit
2ee9172fef
@ -1,7 +1,7 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
# replace with your username:
|
# replace with your username:
|
||||||
name = guan
|
name = guan
|
||||||
version = 0.1.130
|
version = 0.1.131
|
||||||
author = guanjihuan
|
author = guanjihuan
|
||||||
author_email = guanjihuan@163.com
|
author_email = guanjihuan@163.com
|
||||||
description = An open source python package
|
description = An open source python package
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Metadata-Version: 2.1
|
Metadata-Version: 2.1
|
||||||
Name: guan
|
Name: guan
|
||||||
Version: 0.1.130
|
Version: 0.1.131
|
||||||
Summary: An open source python package
|
Summary: An open source python package
|
||||||
Home-page: https://py.guanjihuan.com
|
Home-page: https://py.guanjihuan.com
|
||||||
Author: guanjihuan
|
Author: guanjihuan
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Module: data_processing
|
# Module: data_processing
|
||||||
|
|
||||||
# AI模型对话
|
# AI模型对话(输入长度不能太长,且回答速度有一定限制)
|
||||||
def chat(prompt='你好', stream=1, model=1, top_p=0.8, temperature=0.85):
|
def chat(prompt='你好', stream=1, model=1, top_p=0.8, temperature=0.85):
|
||||||
import socket
|
import socket
|
||||||
import json
|
import json
|
||||||
@ -20,6 +20,8 @@ def chat(prompt='你好', stream=1, model=1, top_p=0.8, temperature=0.85):
|
|||||||
print('\n--- Begin Stream Message ---\n')
|
print('\n--- Begin Stream Message ---\n')
|
||||||
response = ''
|
response = ''
|
||||||
while True:
|
while True:
|
||||||
|
if prompt == '':
|
||||||
|
break
|
||||||
try:
|
try:
|
||||||
data = client_socket.recv(1024)
|
data = client_socket.recv(1024)
|
||||||
if data != b'':
|
if data != b'':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user