fix bug
Build-Deploy-Actions Details

This commit is contained in:
jlhu4 2023-09-14 17:49:31 +08:00
parent 8f4aed76ec
commit 8fb2632655
7 changed files with 1 additions and 39 deletions

Binary file not shown.

View File

@ -1 +1 @@
是谁

View File

@ -1,37 +0,0 @@
import gradio as gr
import random
import os
import sys
import importlib
from sample.aipass_client import execute
def generate_text(message):
svcID = 's6fb9d652'
data_md = importlib.import_module(svcID)
data_md.request_data['header']['app_id'] = data_md.APPId
queryMsg_path = data_md.request_data['payload']['text']['text']
print("queryMsg_path ", queryMsg_path)
with open(queryMsg_path, 'w+') as f:
f.write(message)
return execute(data_md.request_url, data_md.request_data, "POST", data_md.APPId, data_md.APIKey, data_md.APISecret)
def respond(message, chat_history):
msg = generate_text(message=message)
chat_history.append([message, msg])
return "", chat_history
def main ():
with gr.Blocks() as demo:
with gr.Column(min_width=800):
chatbot = gr.Chatbot()
with gr.Row():
message = gr.Textbox(min_width=730)
clear = gr.ClearButton([message, chatbot])
message.submit(respond, [message, chatbot], [message, chatbot])
demo.queue().launch( server_name="0.0.0.0")

View File

@ -39,7 +39,6 @@ def del_file(filepath):
:return:
"""
if not os.path.exists(filepath):
print(f"路径 {filepath} 不存在,无需删除。")
return
del_list = os.listdir(filepath)
for f in del_list: