Update app.py
Browse files
app.py
CHANGED
@@ -43,12 +43,12 @@ def indian_to_english(sentence):
|
|
43 |
return (translation_tokenizer.batch_decode(generated_tokens, skip_special_tokens=True))
|
44 |
|
45 |
def intitalize_lang(language):
|
46 |
-
translation_tokenizer.src_lang = "en_xx"
|
47 |
-
encoded_hi = translation_tokenizer(sentence, return_tensors="pt")
|
48 |
-
generated_tokens = translation_model.generate(**encoded_hi, forced_bos_token_id=translation_tokenizer.lang_code_to_id[language] )
|
49 |
-
x = translation_tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
|
50 |
print(language)
|
51 |
-
return x
|
52 |
|
53 |
|
54 |
llm_model = "mistralai/Mistral-7B-Instruct-v0.2"
|
|
|
43 |
return (translation_tokenizer.batch_decode(generated_tokens, skip_special_tokens=True))
|
44 |
|
45 |
def intitalize_lang(language):
|
46 |
+
# translation_tokenizer.src_lang = "en_xx"
|
47 |
+
# encoded_hi = translation_tokenizer(sentence, return_tensors="pt")
|
48 |
+
# generated_tokens = translation_model.generate(**encoded_hi, forced_bos_token_id=translation_tokenizer.lang_code_to_id[language] )
|
49 |
+
# x = translation_tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
|
50 |
print(language)
|
51 |
+
# return x
|
52 |
|
53 |
|
54 |
llm_model = "mistralai/Mistral-7B-Instruct-v0.2"
|