Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -57,7 +57,7 @@ def refusal_condition(query):
|
|
57 |
if x in query_remove_space:
|
58 |
is_including_tw = True
|
59 |
is_including_cn = False
|
60 |
-
for x in ['中國', '中国', 'cn', '大陸', '內地', '大陆', '内地', '中華人民共和國', '中华人民共和国']:
|
61 |
if x in query_remove_space:
|
62 |
is_including_cn = True
|
63 |
if is_including_tw and is_including_cn:
|
@@ -170,10 +170,10 @@ with gr.Blocks() as demo:
|
|
170 |
else:
|
171 |
history[-1][1] += delta
|
172 |
|
173 |
-
if refusal_condition(history[-1][1]):
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
yield history
|
178 |
|
179 |
if history[-1][1].endswith('</s>'):
|
|
|
57 |
if x in query_remove_space:
|
58 |
is_including_tw = True
|
59 |
is_including_cn = False
|
60 |
+
for x in ['中國', '中国', 'cn', 'china', '大陸', '內地', '大陆', '内地', '中華人民共和國', '中华人民共和国']:
|
61 |
if x in query_remove_space:
|
62 |
is_including_cn = True
|
63 |
if is_including_tw and is_including_cn:
|
|
|
170 |
else:
|
171 |
history[-1][1] += delta
|
172 |
|
173 |
+
# if refusal_condition(history[-1][1]):
|
174 |
+
# history = [['[安全拒答啟動]', '[安全拒答啟動] 請清除再開啟對話']]
|
175 |
+
# yield history
|
176 |
+
# break
|
177 |
yield history
|
178 |
|
179 |
if history[-1][1].endswith('</s>'):
|