diff --git a/__main__.py b/__main__.py index 4a1988e..231fd83 100644 --- a/__main__.py +++ b/__main__.py @@ -383,7 +383,8 @@ class ChatBot(ChatBotFrame): # Start self.auto_opentab_delay() - demo.queue(concurrency_count=CONCURRENT_COUNT).launch(server_name="0.0.0.0", server_port=PORT, auth=AUTHENTICATION) + demo.queue(concurrency_count=CONCURRENT_COUNT).launch(server_name="0.0.0.0", server_port=PORT, auth=AUTHENTICATION, + blocked_paths=["config.py", "config_private.py", "docker-compose.yml", "Dockerfile"]) def check_proxy_free(): diff --git a/func_box.py b/func_box.py index 83d303d..c300b9a 100644 --- a/func_box.py +++ b/func_box.py @@ -481,8 +481,9 @@ def thread_write_chat(chatbot): """ private_key = toolbox.get_conf('private_key')[0] chat_title = chatbot[0][0].split() - i_say = chatbot[-1][0].strip('
/p') - gpt_result = chatbot[-1][1].strip('
/p') + + i_say = re.sub(r'^
|<\/p><\/div>$', '', chatbot[-1][0]) + gpt_result = re.sub(r'^
|<\/p><\/div>$', '', chatbot[-1][1]) if private_key in chat_title: SqliteHandle(f'ai_private_{chat_title[-2]}').inset_prompt({i_say: gpt_result}) else: @@ -543,4 +544,4 @@ class JsonHandle: if __name__ == '__main__': - print(JsonHandle('/Users/kilig/Job/Python-project/academic_gpt/test.json').load()) + pass \ No newline at end of file