Update modules/app.py
Browse files- modules/app.py +3 -3
modules/app.py
CHANGED
@@ -34,21 +34,21 @@ device = "cpu" # or "cuda"
|
|
34 |
|
35 |
# Language Prediction model
|
36 |
print("\nimporting Language Prediction model")
|
37 |
-
lang_model_file = "modules/
|
38 |
lang_model_full_path = os.path.join(os.path.dirname(__file__), lang_model_file)
|
39 |
lang_model = fasttext.load_model(lang_model_full_path)
|
40 |
|
41 |
|
42 |
# Load the source SentencePiece model
|
43 |
print("\nimporting SentencePiece model")
|
44 |
-
sp_model_file = "modules/
|
45 |
sp_model_full_path = os.path.join(os.path.dirname(__file__), sp_model_file)
|
46 |
sp = spm.SentencePieceProcessor()
|
47 |
sp.load(sp_model_full_path)
|
48 |
|
49 |
# Import The Translator model
|
50 |
print("\nimporting Translator model")
|
51 |
-
ct_model_file = "modules/
|
52 |
ct_model_full_path = os.path.join(os.path.dirname(__file__), ct_model_file)
|
53 |
translator = ctranslate2.Translator(ct_model_full_path, device)
|
54 |
|
|
|
34 |
|
35 |
# Language Prediction model
|
36 |
print("\nimporting Language Prediction model")
|
37 |
+
lang_model_file = "modules/lid218e.bin"
|
38 |
lang_model_full_path = os.path.join(os.path.dirname(__file__), lang_model_file)
|
39 |
lang_model = fasttext.load_model(lang_model_full_path)
|
40 |
|
41 |
|
42 |
# Load the source SentencePiece model
|
43 |
print("\nimporting SentencePiece model")
|
44 |
+
sp_model_file = "modules/spm.model"
|
45 |
sp_model_full_path = os.path.join(os.path.dirname(__file__), sp_model_file)
|
46 |
sp = spm.SentencePieceProcessor()
|
47 |
sp.load(sp_model_full_path)
|
48 |
|
49 |
# Import The Translator model
|
50 |
print("\nimporting Translator model")
|
51 |
+
ct_model_file = "modules/sematrans-3.3B"
|
52 |
ct_model_full_path = os.path.join(os.path.dirname(__file__), ct_model_file)
|
53 |
translator = ctranslate2.Translator(ct_model_full_path, device)
|
54 |
|