Skip to content

Commit 6287b80

Browse files
committed
Fixes
1 parent 3243d92 commit 6287b80

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

config.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@
66
load_dotenv(override=True)
77
EMAIL_ALERTS_ENABLED = os.getenv("EMAIL_ALERTS_ENABLED")
88
MAX_TOKENS_PER_IP = 5_000
9-
token_usage = defaultdict(int)
9+
token_usage = defaultdict(int)
10+
ABUSE_MESSAGE = (
11+
"Has alcanzado el límite de uso para esta sesión.\n"
12+
"Si deseas continuar, contáctame en otro momento."
13+
)

main.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,7 @@ def chatting(message, history, request: gr.Request | None = None):
255255
)
256256
abuse_notified.add(ip)
257257

258-
return (
259-
"Has alcanzado el límite de uso para esta sesión."
260-
"Si deseas continuar, contáctame en otro momento."
261-
)
258+
return ABUSE_MESSAGE
262259

263260
# 2️⃣ Registrar input del usuario
264261
register_token_usage(ip, [message])

0 commit comments

Comments
 (0)