Spaces:
Running
Running
add sponsors section
Browse files- app.py +27 -4
- img/gulbenkian.svg +1 -0
- translate.png → img/translate.png +0 -0
app.py
CHANGED
@@ -8,6 +8,7 @@ from uuid import uuid4
|
|
8 |
from datetime import datetime
|
9 |
from huggingface_hub import CommitScheduler
|
10 |
from translation import Translator, LANGUAGES
|
|
|
11 |
|
12 |
|
13 |
|
@@ -94,11 +95,11 @@ with gr.Blocks(title="Արեւմտահայերէն-Անգլերէն Մեքենա
|
|
94 |
|
95 |
### Ստեղծող՝ | Created By: Ari Nubar Boyacıoğlu (<https://www.arinubar.com/>)
|
96 |
|
97 |
-
Հոս կը ցուցադրուի առաջին արեւմտահայերէն-անգլերէն մեքենական թարգմանիչը, որ կարուցուած է Մեթայի (Ֆեյսպուքի) 'No Language Left Behind' տիպարի հիման վրայ։ Թարգմանութեան տիպարը կ'աշխատի CPU-ի մը մէջ, ուրեմն նախադասութեան մը թարգմանութիւնը կրնայ տեւել մօտաւորապէս 40-60
|
98 |
|
99 |
Դուք թարգմանութեան որակին մասին ձեր գնահատութիւնը կրնաք տալ երեք գնահատութեան կոճակներէ մէկուն սեղմելով։ Լեզուի, մուտքի եւ ելքի գրութիւններու, յարաչափերու եւ ձեր գնահատութեան մասին տուեալները պիտի պահուին։ Գնահատութիւնը պարտաւոր չէ։
|
100 |
|
101 |
-
This is the demo of the first Western Armenian-English neural machine translation system which is based on Meta's 'No Language Left Behind' model. The model runs on a CPU, so it might take approximately 40-60 seconds to translate a single sentence. Your feedback and comments are very important for us to improve the quality of the translation.
|
102 |
|
103 |
You can give your feedback about the quality of the translation by clicking one of the three feedback buttons. Information about source, target languages, input and output texts, parameters and your feedback about quality will be saved. It is not mandatory to give feedback.
|
104 |
"""
|
@@ -138,9 +139,31 @@ with gr.Blocks(title="Արեւմտահայերէն-Անգլերէն Մեքենա
|
|
138 |
flag_average_btn.click(save_json, inputs=[src_lang, tgt_lang, text, translated, by_sentence, clean, num_beams, flag_average_btn], outputs=None)
|
139 |
flag_bad_btn.click(save_json, inputs=[src_lang, tgt_lang, text, translated, by_sentence, clean, num_beams, flag_bad_btn], outputs=None)
|
140 |
|
141 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
|
143 |
|
144 |
if __name__ == "__main__":
|
145 |
translator = Translator()
|
146 |
-
demo.launch(favicon_path="translate.png")
|
|
|
8 |
from datetime import datetime
|
9 |
from huggingface_hub import CommitScheduler
|
10 |
from translation import Translator, LANGUAGES
|
11 |
+
import gradio as gr
|
12 |
|
13 |
|
14 |
|
|
|
95 |
|
96 |
### Ստեղծող՝ | Created By: Ari Nubar Boyacıoğlu (<https://www.arinubar.com/>)
|
97 |
|
98 |
+
Հոս կը ցուցադրուի առաջին արեւմտահայերէն-անգլերէն մեքենական թարգմանիչը, որ կարուցուած է Մեթայի (Ֆեյսպուքի) 'No Language Left Behind' տիպարի հիման վրայ։ Թարգմանութեան տիպարը կ'աշխատի CPU-ի մը մէջ, ուրեմն նախադասութեան մը թարգմանութիւնը կրնայ տեւել մօտաւորապէս **40-60 երկվայրկեան**։ Ձեր գնահատութիւնները եւ քննադատութիւնները շատ կարեւոր են տիպարի թարգմանութեան որակը բարելաւելու համար։
|
99 |
|
100 |
Դուք թարգմանութեան որակին մասին ձեր գնահատութիւնը կրնաք տալ երեք գնահատութեան կոճակներէ մէկուն սեղմելով։ Լեզուի, մուտքի եւ ելքի գրութիւններու, յարաչափերու եւ ձեր գնահատութեան մասին տուեալները պիտի պահուին։ Գնահատութիւնը պարտաւոր չէ։
|
101 |
|
102 |
+
This is the demo of the first Western Armenian-English neural machine translation system which is based on Meta's 'No Language Left Behind' model. The model runs on a CPU, so it might take approximately **40-60 seconds** to translate a single sentence. Your feedback and comments are very important for us to improve the quality of the translation.
|
103 |
|
104 |
You can give your feedback about the quality of the translation by clicking one of the three feedback buttons. Information about source, target languages, input and output texts, parameters and your feedback about quality will be saved. It is not mandatory to give feedback.
|
105 |
"""
|
|
|
139 |
flag_average_btn.click(save_json, inputs=[src_lang, tgt_lang, text, translated, by_sentence, clean, num_beams, flag_average_btn], outputs=None)
|
140 |
flag_bad_btn.click(save_json, inputs=[src_lang, tgt_lang, text, translated, by_sentence, clean, num_beams, flag_bad_btn], outputs=None)
|
141 |
|
142 |
+
visitor_badge_html = """
|
143 |
+
<a href="https://visitorbadge.io/status?path=https%3A%2F%2Farinubar-hyw-en-demo.hf.space%2F">
|
144 |
+
<img src="https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Farinubar-hyw-en-demo.hf.space%2F&label=%D4%B1%D5%B5%D6%81%D5%A5%D5%AC%D5%B8%D6%82%D5%B6%D5%A5%D6%80%20%7C%20Visitors&countColor=%23f97316&style=flat" />
|
145 |
+
</a>
|
146 |
+
"""
|
147 |
+
|
148 |
+
gr.HTML(visitor_badge_html)
|
149 |
+
|
150 |
+
|
151 |
+
|
152 |
+
sponsors_html = """
|
153 |
+
<div style="display: flex; justify-content: center; align-items: center; margin-bottom: 5px;">
|
154 |
+
<h3>Աջակցութեամբ՝ | Supported By: </h3>
|
155 |
+
</div>
|
156 |
+
<div style="display: flex; justify-content: center; align-items: center;">
|
157 |
+
<a href="https://gulbenkian.pt/armenian-communities/">
|
158 |
+
<img src="https://cdn.gulbenkian.pt/armenian-communities/wp-content/uploads/sites/23/2022/03/Logo__Amenian-Communities-EN.svg" alt="Calouste Gulbenkian Foundation - Armenian Communities" style="background-color: #414142; padding: 10px" />
|
159 |
+
<img src="file/img/gulbenkian.svg" alt="Calouste Gulbenkian Foundation - Armenian Communities" style="background-color: #414142; padding: 10px" />
|
160 |
+
</a>
|
161 |
+
</div>
|
162 |
+
|
163 |
+
"""
|
164 |
+
gr.HTML(sponsors_html)
|
165 |
|
166 |
|
167 |
if __name__ == "__main__":
|
168 |
translator = Translator()
|
169 |
+
demo.launch(favicon_path="img/translate.png", share=True, allowed_paths=["./img"])
|
img/gulbenkian.svg
ADDED
|
translate.png → img/translate.png
RENAMED
File without changes
|