fix bug
Build-Deploy-Actions
Details
Build-Deploy-Actions
Details
This commit is contained in:
parent
8f4aed76ec
commit
8fb2632655
Binary file not shown.
|
@ -1 +1 @@
|
|||
你是谁
|
||||
你好
|
|
@ -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")
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue