Spaces:
Runtime error
Runtime error
updt
Browse files
app.py
CHANGED
@@ -21,9 +21,10 @@ nllb_tokenizer = AutoTokenizer.from_pretrained(nllb_model_name)
|
|
21 |
|
22 |
def get_chinese_translation(text): #in_language_first, in_language_second,
|
23 |
print("********Inside get_chinese_translation ********")
|
24 |
-
print(f"text is :{text}, source language is : {in_language_first}, target language is : {in_language_second} ")
|
25 |
src = 'eng_Latn'
|
26 |
tgt= 'zho_Hans'
|
|
|
|
|
27 |
translator = pipeline('translation', model=nllb_model, tokenizer=nllb_tokenizer, src_lang=src, tgt_lang=tgt)
|
28 |
output = translator(text, max_length=400)
|
29 |
print(f"initial output is:{output}")
|
|
|
21 |
|
22 |
def get_chinese_translation(text): #in_language_first, in_language_second,
|
23 |
print("********Inside get_chinese_translation ********")
|
|
|
24 |
src = 'eng_Latn'
|
25 |
tgt= 'zho_Hans'
|
26 |
+
print(f"text is :{text}, source language is : {in_language_first}, target language is : {in_language_second} ")
|
27 |
+
|
28 |
translator = pipeline('translation', model=nllb_model, tokenizer=nllb_tokenizer, src_lang=src, tgt_lang=tgt)
|
29 |
output = translator(text, max_length=400)
|
30 |
print(f"initial output is:{output}")
|