Vishwas1 commited on
Commit
02c7aec
·
1 Parent(s): a73d35f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -3,6 +3,7 @@ import requests
3
  import os
4
  import polyglot
5
  from polyglot.transliteration import Transliterator
 
6
 
7
 
8
  ##Bloom Inference API
@@ -80,9 +81,9 @@ with demo:
80
  """This is my playground to test Marathi and Hindi Text Generation"""
81
  )
82
  with gr.Row():
83
- input_prompt = gr.Textbox(label="Write some text to get started...", lines=3, value="Mazya Marathicha bol")
84
- transliterator = Transliterator(source_lang="en", target_lang="mr")
85
- input_prompt = transliterator.transliterate(input_prompt)
86
  with gr.Row():
87
  generated_txt = gr.Textbox(lines=25, visible = True)
88
 
 
3
  import os
4
  import polyglot
5
  from polyglot.transliteration import Transliterator
6
+ from ai4bharat.transliteration import XlitEngine
7
 
8
 
9
  ##Bloom Inference API
 
81
  """This is my playground to test Marathi and Hindi Text Generation"""
82
  )
83
  with gr.Row():
84
+ input_prompt = gr.Textbox(label="Write some text to get started...", lines=3, value="Ishq kya hai ki")
85
+ e = XlitEngine("hi", beam_width=10, rescore=True)
86
+ input_prompt = e.translit_word(input_prompt, topk=1)
87
  with gr.Row():
88
  generated_txt = gr.Textbox(lines=25, visible = True)
89