Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1236,14 +1236,12 @@ def cut_message(message: str):
|
|
1236 |
|
1237 |
def safe_check(func, message, key_message=None):
|
1238 |
try:
|
1239 |
-
# Если функция ожидает 2 аргумента (например, check_no_word_repetitions),
|
1240 |
-
# передаём key_message:
|
1241 |
import inspect
|
1242 |
sig = inspect.signature(func)
|
1243 |
if len(sig.parameters) == 2:
|
1244 |
-
return
|
1245 |
else:
|
1246 |
-
return
|
1247 |
except Exception as e:
|
1248 |
return None
|
1249 |
|
@@ -1302,7 +1300,7 @@ def format_checks(checks):
|
|
1302 |
else:
|
1303 |
symbol = '❓'
|
1304 |
formatted_results.append(f"{translation[rule]}: {symbol}")
|
1305 |
-
return "\n".join(formatted_results)
|
1306 |
|
1307 |
|
1308 |
with gr.Blocks(theme="default") as demo:
|
|
|
1236 |
|
1237 |
def safe_check(func, message, key_message=None):
|
1238 |
try:
|
|
|
|
|
1239 |
import inspect
|
1240 |
sig = inspect.signature(func)
|
1241 |
if len(sig.parameters) == 2:
|
1242 |
+
return func(message, key_message)
|
1243 |
else:
|
1244 |
+
return func(message)
|
1245 |
except Exception as e:
|
1246 |
return None
|
1247 |
|
|
|
1300 |
else:
|
1301 |
symbol = '❓'
|
1302 |
formatted_results.append(f"{translation[rule]}: {symbol}")
|
1303 |
+
return " \n".join(formatted_results)
|
1304 |
|
1305 |
|
1306 |
with gr.Blocks(theme="default") as demo:
|