DeMaking commited on
Commit
2242725
·
verified ·
1 Parent(s): 86cf6d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -29,15 +29,15 @@ login(token=HF_HUB_TOKEN)
29
 
30
 
31
  # # Function to detect language
32
- # def detect_language(user_input):
33
- # try:
34
- # # lang = detect(user_input)
35
- # lang, _ = langid.classify(user_input) # langid.classify returns a tuple (language, confidence)
36
- # print(f"Detected language: {lang}, ", f"current time: {current_time_gmt()}")
37
- # return "hebrew" if lang == "he" else "english" if lang == "en" else "unsupported"
38
- # except Exception as e:
39
- # print(f"Language detection error: {e}")
40
- # return "unsupported"
41
 
42
 
43
  # Function to generate a response
 
29
 
30
 
31
  # # Function to detect language
32
+ def detect_language(user_input):
33
+ try:
34
+ # lang = detect(user_input)
35
+ lang, _ = langid.classify(user_input) # langid.classify returns a tuple (language, confidence)
36
+ print(f"Detected language: {lang}, ", f"current time: {current_time_gmt()}")
37
+ return "hebrew" if lang == "he" else "english" if lang == "en" else "unsupported"
38
+ except Exception as e:
39
+ print(f"Language detection error: {e}")
40
+ return "unsupported"
41
 
42
 
43
  # Function to generate a response