Spaces:
Build error
Build error
Commit
·
f6af0d2
1
Parent(s):
5970cbf
Updated Description and Article
Browse files
app.py
CHANGED
@@ -12,11 +12,11 @@ os.system('unzip /home/user/app/indic-en.zip')
|
|
12 |
|
13 |
i2i_model_download = "wget --show-progress -O m2m.tar https://ai4b-my.sharepoint.com/:u:/g/personal/sumanthdoddapaneni_ai4bharat_org/Eajn_jJIp5NEqeyqZ0GW4FgBdiANlZNQiy7dlwkaNr8DHw?download=1"
|
14 |
os.system(i2i_model_download)
|
15 |
-
os.system("tar -xvf /home/user/app/m2m.tar")
|
16 |
|
17 |
-
en2indic_model = Model(expdir='/home/user/app/en-indic')
|
18 |
-
indic2en_model = Model(expdir='/home/user/app/indic-en')
|
19 |
-
indic2indic_model = Model(expdir='/home/user/app/m2m')
|
20 |
|
21 |
LANGUAGES = {"Assamese": "as", "Bengali": "bn", "Gujarati": "gu", "Hindi": "hi", "Kannada": "kn",
|
22 |
"Malayalam": "ml", "Marathi": "mr", "Odia": "or", "Punjabi": "pa", "Tamil": "ta", "Telugu": "te", "English": "en"}
|
@@ -49,6 +49,23 @@ text = gr.inputs.Textbox(lines=5, placeholder="Enter Text to translate",
|
|
49 |
|
50 |
supported_lang = ', '.join(languages)
|
51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
interface_article = """
|
53 |
<html>
|
54 |
<body>
|
@@ -64,13 +81,14 @@ interface_article = """
|
|
64 |
The models used in this interface are multilingual single-script transformer based models for translating between English and Indian languages. The models are trained using the Samanantar corpus and at the time of their release was the state of the art open source model as evaluated on Facebook's FLORES benchmark.
|
65 |
</span>
|
66 |
<br/>
|
67 |
-
<
|
68 |
-
|
69 |
-
</
|
70 |
<ul>
|
71 |
-
<li>
|
72 |
-
<li>
|
73 |
-
<li>
|
|
|
74 |
</ul>
|
75 |
</div>
|
76 |
</body>
|
@@ -84,6 +102,6 @@ examples = [
|
|
84 |
]
|
85 |
|
86 |
|
87 |
-
iface = gr.Interface(fn=translate, inputs=[text, fromChoice, toChoice], outputs=text_output,
|
88 |
-
|
89 |
iface.launch(enable_queue=True)
|
|
|
12 |
|
13 |
i2i_model_download = "wget --show-progress -O m2m.tar https://ai4b-my.sharepoint.com/:u:/g/personal/sumanthdoddapaneni_ai4bharat_org/Eajn_jJIp5NEqeyqZ0GW4FgBdiANlZNQiy7dlwkaNr8DHw?download=1"
|
14 |
os.system(i2i_model_download)
|
15 |
+
# os.system("tar -xvf /home/user/app/m2m.tar")
|
16 |
|
17 |
+
# en2indic_model = Model(expdir='/home/user/app/en-indic')
|
18 |
+
# indic2en_model = Model(expdir='/home/user/app/indic-en')
|
19 |
+
# indic2indic_model = Model(expdir='/home/user/app/m2m')
|
20 |
|
21 |
LANGUAGES = {"Assamese": "as", "Bengali": "bn", "Gujarati": "gu", "Hindi": "hi", "Kannada": "kn",
|
22 |
"Malayalam": "ml", "Marathi": "mr", "Odia": "or", "Punjabi": "pa", "Tamil": "ta", "Telugu": "te", "English": "en"}
|
|
|
49 |
|
50 |
supported_lang = ', '.join(languages)
|
51 |
|
52 |
+
interface_description = f"""
|
53 |
+
<html>
|
54 |
+
<body>
|
55 |
+
<h1>
|
56 |
+
Usage:
|
57 |
+
</h1>
|
58 |
+
<ul>
|
59 |
+
<li>Choose the Source Language and Target Language for translation.</li>
|
60 |
+
<li>Enter your text in source language in the textbox.</li>
|
61 |
+
<li>Click Submit and view your translated output.</li>
|
62 |
+
</ul>
|
63 |
+
<br/>
|
64 |
+
<span>Currently the model supports {supported_lang} </span>
|
65 |
+
</body>
|
66 |
+
</html>
|
67 |
+
"""
|
68 |
+
|
69 |
interface_article = """
|
70 |
<html>
|
71 |
<body>
|
|
|
81 |
The models used in this interface are multilingual single-script transformer based models for translating between English and Indian languages. The models are trained using the Samanantar corpus and at the time of their release was the state of the art open source model as evaluated on Facebook's FLORES benchmark.
|
82 |
</span>
|
83 |
<br/>
|
84 |
+
<h4>
|
85 |
+
These models are currently being used on AI Tools/Platforms such as:
|
86 |
+
</h4>
|
87 |
<ul>
|
88 |
+
<li><a href="https://ai4bharat.org/shoonya">Shoonya</a></li>
|
89 |
+
<li><a href="https://ai4bharat.org/chitralekha">Chitralekha</a> (deployed for NPTEL)</li>
|
90 |
+
<li><a href="https://ai4bharat.org/anuvaad">Anuvaad</a> (deployed for Supreme Court of India & Bangladesh)</li>
|
91 |
+
<li>Pratham Books</li>
|
92 |
</ul>
|
93 |
</div>
|
94 |
</body>
|
|
|
102 |
]
|
103 |
|
104 |
|
105 |
+
iface = gr.Interface(fn=translate, inputs=[text, fromChoice, toChoice], outputs=text_output,
|
106 |
+
title='IndicTrans - Multilingual Translation', description=interface_description, article=interface_article, examples=examples)
|
107 |
iface.launch(enable_queue=True)
|