From 5d5bd912d9f27f67a9aece3a00581eea47abf1cc Mon Sep 17 00:00:00 2001 From: guanjihuan Date: Sat, 14 Dec 2024 02:02:33 +0800 Subject: [PATCH] 0.1.130 --- PyPI/setup.cfg | 2 +- PyPI/src/guan.egg-info/PKG-INFO | 2 +- PyPI/src/guan/data_processing.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PyPI/setup.cfg b/PyPI/setup.cfg index 01b1765..cf367c1 100644 --- a/PyPI/setup.cfg +++ b/PyPI/setup.cfg @@ -1,7 +1,7 @@ [metadata] # replace with your username: name = guan -version = 0.1.129 +version = 0.1.130 author = guanjihuan author_email = guanjihuan@163.com description = An open source python package diff --git a/PyPI/src/guan.egg-info/PKG-INFO b/PyPI/src/guan.egg-info/PKG-INFO index 861f881..72f01e0 100644 --- a/PyPI/src/guan.egg-info/PKG-INFO +++ b/PyPI/src/guan.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: guan -Version: 0.1.129 +Version: 0.1.130 Summary: An open source python package Home-page: https://py.guanjihuan.com Author: guanjihuan diff --git a/PyPI/src/guan/data_processing.py b/PyPI/src/guan/data_processing.py index cea6d8c..f79c2f1 100644 --- a/PyPI/src/guan/data_processing.py +++ b/PyPI/src/guan/data_processing.py @@ -1,7 +1,7 @@ # Module: data_processing # 模型对话 -def chat(prompt='你好', model=1, stream=0, top_p=0.8, temperature=0.85): +def chat(prompt='你好', stream=1, model=1, top_p=0.8, temperature=0.85): import socket import json with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as client_socket: @@ -32,12 +32,12 @@ def chat(prompt='你好', model=1, stream=0, top_p=0.8, temperature=0.85): break else: if stream == 1: - print(stream_response) + print(stream_response, end='') except: break client_socket.close() if stream == 1: - print('\n--- End Stream Message ---\n') + print('\n\n--- End Stream Message ---\n') return response # 在云端服务器上运行函数(需要函数是独立可运行的代码)