Skip to content

Commit

Permalink
[#143] Double check lang detection only for fr
Browse files Browse the repository at this point in the history
  • Loading branch information
wayangalihpratama committed Dec 10, 2024
1 parent 863658c commit 52834ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assistant/assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ def get_language(user_prompt) -> str:
except LangDetectException:
return "en"

# Double check to make sure not en
if detected_language != "en":
# Double check with nltk library
if detected_language == "fr":
# Tokenize the text to get individual words
tokens = nltk.word_tokenize(user_prompt.lower())

Expand Down

0 comments on commit 52834ae

Please sign in to comment.