This commit is contained in:
guanjihuan 2023-11-14 23:56:50 +08:00
parent 7ae2640f74
commit 7190c99b8e
3 changed files with 5 additions and 5 deletions

View File

@ -1,7 +1,7 @@
[metadata] [metadata]
# replace with your username: # replace with your username:
name = guan name = guan
version = 0.1.28 version = 0.1.29
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

View File

@ -1,6 +1,6 @@
Metadata-Version: 2.1 Metadata-Version: 2.1
Name: guan Name: guan
Version: 0.1.28 Version: 0.1.29
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

View File

@ -384,15 +384,15 @@ def get_PID(name):
guan.statistics_of_guan_package() guan.statistics_of_guan_package()
return id_running return id_running
# 在CPU上运行大语言模型通过Python函数调用 # 在服务器上运行大语言模型通过Python函数调用
def chat(message='你好', stream_show=1): def chat(prompt='你好', stream_show=1):
import socket import socket
response = '' response = ''
try: try:
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as client_socket: with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as client_socket:
client_socket.settimeout(10) client_socket.settimeout(10)
client_socket.connect(('socket.guanjihuan.com', 12345)) client_socket.connect(('socket.guanjihuan.com', 12345))
send_message = "chat.guanjihuan.com |---| " + message send_message = "chat.guanjihuan.com |---| " + prompt
client_socket.send(send_message.encode()) client_socket.send(send_message.encode())
try: try:
while True: while True: