Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
@@ -1114,14 +1114,66 @@ def netOrNotnet(
|
|
1114 |
response, history = model.chat(tokenizer, user_input_prompt,top_p=0.2, temperature=0.85, history=[])
|
1115 |
ytkeywords = ['否。', '不需要通过网络']
|
1116 |
|
1117 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1118 |
|
1119 |
print(user_input_original)
|
1120 |
-
print(response)
|
1121 |
print(NET)
|
1122 |
if NET:
|
1123 |
-
yield from
|
1124 |
-
RETRY_FLAG,# type: ignore
|
1125 |
user_input_original,
|
1126 |
chatbot,
|
1127 |
max_length,
|
@@ -1130,11 +1182,9 @@ def netOrNotnet(
|
|
1130 |
history=[],
|
1131 |
past_key_values=None,
|
1132 |
)
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
else:
|
1137 |
-
yield from
|
|
|
1138 |
user_input_original,
|
1139 |
chatbot,
|
1140 |
max_length,
|
|
|
1114 |
response, history = model.chat(tokenizer, user_input_prompt,top_p=0.2, temperature=0.85, history=[])
|
1115 |
ytkeywords = ['否。', '不需要通过网络']
|
1116 |
|
1117 |
+
ytkeywords = ["此刻",
|
1118 |
+
"最",
|
1119 |
+
"目前",
|
1120 |
+
"当下",
|
1121 |
+
"当前",
|
1122 |
+
"近期",
|
1123 |
+
"眼下",
|
1124 |
+
"最新",
|
1125 |
+
"最近",
|
1126 |
+
"近来",
|
1127 |
+
"今时",
|
1128 |
+
"现今",
|
1129 |
+
"即时",
|
1130 |
+
"当今",
|
1131 |
+
"当下时刻",
|
1132 |
+
"当代",
|
1133 |
+
"当下的",
|
1134 |
+
"最新的",
|
1135 |
+
"时下",
|
1136 |
+
"今天",
|
1137 |
+
"新近",
|
1138 |
+
"不久前",
|
1139 |
+
"近日",
|
1140 |
+
"最新消息",
|
1141 |
+
"此时",
|
1142 |
+
"这时",
|
1143 |
+
"近年来",
|
1144 |
+
"这阵子",
|
1145 |
+
"目前为止",
|
1146 |
+
"近来的",
|
1147 |
+
"眼前",
|
1148 |
+
"当下情况",
|
1149 |
+
"眼前的",
|
1150 |
+
"现阶段",
|
1151 |
+
"最近的",
|
1152 |
+
"如今",
|
1153 |
+
"当前的",
|
1154 |
+
"现行",
|
1155 |
+
"现阶段的",
|
1156 |
+
"现今的",
|
1157 |
+
"现今时刻",
|
1158 |
+
"眼前状况",
|
1159 |
+
"最新的信息",
|
1160 |
+
"眼下状况",
|
1161 |
+
"眼下情况",
|
1162 |
+
"当下发生的",
|
1163 |
+
"目前的情况",
|
1164 |
+
"目前状况",
|
1165 |
+
"目前发生的",
|
1166 |
+
"最新的情报"
|
1167 |
+
"现在",
|
1168 |
+
"当前",
|
1169 |
+
"最近"]
|
1170 |
+
|
1171 |
+
NET = any(keyword in user_input for keyword in ytkeywords)
|
1172 |
|
1173 |
print(user_input_original)
|
|
|
1174 |
print(NET)
|
1175 |
if NET:
|
1176 |
+
yield from GGSearch(
|
|
|
1177 |
user_input_original,
|
1178 |
chatbot,
|
1179 |
max_length,
|
|
|
1182 |
history=[],
|
1183 |
past_key_values=None,
|
1184 |
)
|
|
|
|
|
|
|
1185 |
else:
|
1186 |
+
yield from predict(
|
1187 |
+
RETRY_FLAG,# type: ignore
|
1188 |
user_input_original,
|
1189 |
chatbot,
|
1190 |
max_length,
|