Skip to content

Commit

Permalink
Merge pull request #4 from atrifat/fix-language-detection-model-multi…
Browse files Browse the repository at this point in the history
…ple-download

feat: Warming up language detection model before starting API server
  • Loading branch information
atrifat authored Oct 11, 2024
2 parents ed0bd65 + 92408a5 commit d25e7c4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
if ENABLE_API_TOKEN and API_TOKEN == "":
raise Exception("API_TOKEN is required if ENABLE_API_TOKEN is enabled")

# Ensure model warmed-up for fast_langdetect before starting API server
if LANGUAGE_DETECTION_MODEL == "fast_langdetect":
detect_multilingual("", low_memory=LOW_MEMORY_MODE)

app = Flask(__name__)

cache_config = {
Expand Down

0 comments on commit d25e7c4

Please sign in to comment.