Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -173,6 +173,10 @@ with gr.Blocks() as demo:
|
|
173 |
if history[-1][1].endswith('</s>'):
|
174 |
history[-1][1] = history[-1][1][:-4]
|
175 |
yield history
|
|
|
|
|
|
|
|
|
176 |
|
177 |
print('== Record ==\nQuery: {query}\nResponse: {response}'.format(query=repr(message), response=repr(history[-1][1])))
|
178 |
|
|
|
173 |
if history[-1][1].endswith('</s>'):
|
174 |
history[-1][1] = history[-1][1][:-4]
|
175 |
yield history
|
176 |
+
|
177 |
+
if refusal_condition(history[-1][1]):
|
178 |
+
history = [['[安全拒答啟動]', '[安全拒答啟動] 請清除再開啟對話']]
|
179 |
+
yield history
|
180 |
|
181 |
print('== Record ==\nQuery: {query}\nResponse: {response}'.format(query=repr(message), response=repr(history[-1][1])))
|
182 |
|