0.1.143
This commit is contained in:
parent
5dbbc968e2
commit
dfeb15c963
@ -1,7 +1,7 @@
|
||||
[metadata]
|
||||
# replace with your username:
|
||||
name = guan
|
||||
version = 0.1.142
|
||||
version = 0.1.143
|
||||
author = guanjihuan
|
||||
author_email = guanjihuan@163.com
|
||||
description = An open source python package
|
||||
|
@ -1,6 +1,6 @@
|
||||
Metadata-Version: 2.2
|
||||
Name: guan
|
||||
Version: 0.1.142
|
||||
Version: 0.1.143
|
||||
Summary: An open source python package
|
||||
Home-page: https://py.guanjihuan.com
|
||||
Author: guanjihuan
|
||||
|
@ -1,23 +1,21 @@
|
||||
# Module: data_processing
|
||||
|
||||
# AI 对话
|
||||
def chat(prompt='你好', stream=1, model=1, top_p=0.8, temperature=0.85):
|
||||
def chat(prompt='你好', stream=1, model=1):
|
||||
import socket
|
||||
import json
|
||||
import time
|
||||
import guan
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as client_socket:
|
||||
client_socket.settimeout(30)
|
||||
client_socket.connect(('socket.guanjihuan.com', 12345))
|
||||
client_socket.connect(('ollama.guanjihuan.com', 12301))
|
||||
split_text_list = guan.split_text(prompt, width=100)
|
||||
message_times = len(split_text_list)
|
||||
if message_times == 1 or message_times == 0:
|
||||
message = {
|
||||
'server': "chat.guanjihuan.com",
|
||||
'server': "ollama.guanjihuan.com",
|
||||
'prompt': prompt,
|
||||
'model': model,
|
||||
'top_p': top_p,
|
||||
'temperature': temperature,
|
||||
}
|
||||
send_message = json.dumps(message)
|
||||
client_socket.send(send_message.encode('utf-8'))
|
||||
@ -28,11 +26,9 @@ def chat(prompt='你好', stream=1, model=1, top_p=0.8, temperature=0.85):
|
||||
end_message = 1
|
||||
prompt_0 = split_text_list[i0]
|
||||
message = {
|
||||
'server': "chat.guanjihuan.com",
|
||||
'server': "ollama.guanjihuan.com",
|
||||
'prompt': prompt_0,
|
||||
'model': model,
|
||||
'top_p': top_p,
|
||||
'temperature': temperature,
|
||||
'end_message': end_message,
|
||||
}
|
||||
send_message = json.dumps(message)
|
||||
@ -105,7 +101,7 @@ def run(function_name, *args, **kwargs):
|
||||
import time
|
||||
import guan
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as client_socket:
|
||||
client_socket.connect(('run.guanjihuan.com', 12345))
|
||||
client_socket.connect(('run.guanjihuan.com', 12302))
|
||||
function_source = guan.get_source(function_name)
|
||||
split_text_list = guan.split_text(function_source, width=100)
|
||||
message_times = len(split_text_list)
|
||||
|
Loading…
x
Reference in New Issue
Block a user