Moshe.download nltk data on start (#1014)

This commit is contained in:
Moshe Zada 2024-01-28 23:05:42 +02:00 committed by GitHub
parent a4053501d0
commit c0c9c67534
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,3 +1,4 @@
import nltk
import time
from threading import Event
from typing import Any
@ -357,6 +358,11 @@ if __name__ == "__main__":
slack_bot_tokens: SlackBotTokens | None = None
socket_client: SocketModeClient | None = None
logger.info("Verifying query preprocessing (NLTK) data is downloaded")
nltk.download("stopwords", quiet=True)
nltk.download('punkt', quiet=True)
while True:
try:
latest_slack_bot_tokens = fetch_tokens()