Spaces:
Runtime error
Runtime error
ChenyuRabbitLove
commited on
Commit
•
2e4fd32
1
Parent(s):
2dc418a
clear state can claer KB
Browse files
app.py
CHANGED
@@ -113,6 +113,7 @@ def bot(history):
|
|
113 |
return history
|
114 |
|
115 |
def clear_state():
|
|
|
116 |
global CONTEXT
|
117 |
global CONTEXT_PAGE_NUM
|
118 |
global CONTEXT_FILE_NAME
|
@@ -120,6 +121,7 @@ def clear_state():
|
|
120 |
CONTEXT = None
|
121 |
CONTEXT_PAGE_NUM = None
|
122 |
CONTEXT_FILE_NAME = None
|
|
|
123 |
|
124 |
with gr.Blocks() as demo:
|
125 |
history = gr.State([])
|
@@ -175,7 +177,7 @@ with gr.Blocks() as demo:
|
|
175 |
2. 在上方輸入欄輸入問題,系統將自動回覆
|
176 |
3. 可以根據下方的摘要內容來提問
|
177 |
4. 每次對話會根據第一個問題的內容來檢索所有文件,並挑選最能回答問題的文件來回覆
|
178 |
-
5.
|
179 |
""")
|
180 |
|
181 |
with gr.Row():
|
|
|
113 |
return history
|
114 |
|
115 |
def clear_state():
|
116 |
+
global KNOWLEDGE_BASE
|
117 |
global CONTEXT
|
118 |
global CONTEXT_PAGE_NUM
|
119 |
global CONTEXT_FILE_NAME
|
|
|
121 |
CONTEXT = None
|
122 |
CONTEXT_PAGE_NUM = None
|
123 |
CONTEXT_FILE_NAME = None
|
124 |
+
KNOWLEDGE_BASE = None
|
125 |
|
126 |
with gr.Blocks() as demo:
|
127 |
history = gr.State([])
|
|
|
177 |
2. 在上方輸入欄輸入問題,系統將自動回覆
|
178 |
3. 可以根據下方的摘要內容來提問
|
179 |
4. 每次對話會根據第一個問題的內容來檢索所有文件,並挑選最能回答問題的文件來回覆
|
180 |
+
5. 要切換檢索的文件,請點選「清除」按鈕後再重新提問
|
181 |
""")
|
182 |
|
183 |
with gr.Row():
|