AriNubar commited on
Commit
faa4b4b
·
1 Parent(s): 053e749

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -1,9 +1,11 @@
1
  # coding: utf-8
2
 
3
  import gradio as gr
 
4
 
5
  from translation import Translator, LANGUAGES
6
  LANGUAGES_LIST = list(LANGUAGES.keys())
 
7
 
8
  def translate_wrapper(text, src_lang, tgt_lang, by_sentence=True, clean=True, num_beams=4):
9
 
@@ -13,6 +15,8 @@ def translate_wrapper(text, src_lang, tgt_lang, by_sentence=True, clean=True, nu
13
  result = translator.translate(text, src_lang, tgt_lang, by_sentence=by_sentence, clean=clean, num_beams=num_beams)
14
  return result
15
 
 
 
16
  desc = "<p>Հոս կը ցուցադրուի առաջին արեւմտահայերէն-անգլերէն մեքենական թարգմանիչը, որ կարուցուած է Մեթայի (Ֆեյսպուքի) 'No Language Left Behind' տիպարի հիման վրայ։ Թարգմանութեան տիպարը կ'աշխատի CPU-ի մը մէջ, ուրեմն նախադասութեան մը թարգմանութիւնը կրնայ տեւել մօտաւորապէս 40-60 երկվայրկեան։ Ձեր գնահատութիւնները եւ քննադատութիւնները շատ կարեւոր են մեզի համար, որոնց հետ տիպարի թարգմանութեան որակը կրնայ բարելաւուիլ։ Շնորհակալութիւն Գալուստ Կիւլպէնկեան Հիմնադրամին, որուն աջակցութեամբ այս նախագիծը իրականացուեցաւ։</p><p></p><p>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. Thanks to the Calouste Gulbenkian Foundation for making this project possible with their support.</p>"
17
  interface = gr.Interface(
18
  translate_wrapper,
 
1
  # coding: utf-8
2
 
3
  import gradio as gr
4
+ import os
5
 
6
  from translation import Translator, LANGUAGES
7
  LANGUAGES_LIST = list(LANGUAGES.keys())
8
+ HF_TOKEN = os.get.environ('HF_TOKEN')
9
 
10
  def translate_wrapper(text, src_lang, tgt_lang, by_sentence=True, clean=True, num_beams=4):
11
 
 
15
  result = translator.translate(text, src_lang, tgt_lang, by_sentence=by_sentence, clean=clean, num_beams=num_beams)
16
  return result
17
 
18
+
19
+ hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN, "AriNubar/hyw-en-crowd-source")
20
  desc = "<p>Հոս կը ցուցադրուի առաջին արեւմտահայերէն-անգլերէն մեքենական թարգմանիչը, որ կարուցուած է Մեթայի (Ֆեյսպուքի) 'No Language Left Behind' տիպարի հիման վրայ։ Թարգմանութեան տիպարը կ'աշխատի CPU-ի մը մէջ, ուրեմն նախադասութեան մը թարգմանութիւնը կրնայ տեւել մօտաւորապէս 40-60 երկվայրկեան։ Ձեր գնահատութիւնները եւ քննադատութիւնները շատ կարեւոր են մեզի համար, որոնց հետ տիպարի թարգմանութեան որակը կրնայ բարելաւուիլ։ Շնորհակալութիւն Գալուստ Կիւլպէնկեան Հիմնադրամին, որուն աջակցութեամբ այս նախագիծը իրականացուեցաւ։</p><p></p><p>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. Thanks to the Calouste Gulbenkian Foundation for making this project possible with their support.</p>"
21
  interface = gr.Interface(
22
  translate_wrapper,