Your Name commited on
Commit
7d5aaa5
1 Parent(s): 67215bc

update comments

Browse files
Files changed (1) hide show
  1. predict.py +11 -0
predict.py CHANGED
@@ -1,5 +1,16 @@
1
  # 借鉴了 https://github.com/GaiZhenbiao/ChuanhuChatGPT 项目
2
 
 
 
 
 
 
 
 
 
 
 
 
3
  import json
4
  import gradio as gr
5
  import logging
 
1
  # 借鉴了 https://github.com/GaiZhenbiao/ChuanhuChatGPT 项目
2
 
3
+ """
4
+ 该文件中主要包含三个函数
5
+
6
+ 不具备多线程能力的函数:
7
+ 1. predict: 正常对话时使用,具备完备的交互功能,不可多线程
8
+
9
+ 具备多线程调用能力的函数
10
+ 2. predict_no_ui:高级实验性功能模块调用,不会实时显示在界面上,参数简单,可以多线程并行,方便实现复杂的功能逻辑
11
+ 3. predict_no_ui_long_connection:在实验过程中发现调用predict_no_ui处理长文档时,和openai的连接容易断掉,这个函数用stream的方式解决这个问题,同样支持多线程
12
+ """
13
+
14
  import json
15
  import gradio as gr
16
  import logging