TwentyNine
commited on
Commit
•
63507dd
1
Parent(s):
811019f
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ def transcribe(input_str):
|
|
8 |
output_str = ''
|
9 |
|
10 |
for input in input_str.split('\n'):
|
11 |
-
input_enc = tokenizer.encode(
|
12 |
output_enc = model.generate(input_enc, max_length=256)
|
13 |
|
14 |
if len(output_str) > 0:
|
@@ -23,8 +23,8 @@ gradio_app = gr.Interface(
|
|
23 |
inputs=gr.Textbox(label='Input (kana)', value='トゥイマ ヒ ワ エエㇰ ワ ヒオーイオイ。ピㇼカノ ヌカㇻ ヤン!', placeholder='トゥイマ ヒ ワ エエㇰ ワ ヒオーイオイ。ピㇼカノ ヌカㇻ ヤン!', info='Ainu text written in Japanese katakana (input).', interactive=True, autofocus=True),
|
24 |
outputs=gr.Textbox(label='Output (alphabet)', info='Ainu text written in the Latin alphabet (output).'),
|
25 |
title='BYT5 Ainu Kana-Latin Converter (V1)',
|
26 |
-
article='<p>Example sentence borrowed from <a href="https://www.hakusuisha.co.jp/book/b584600.html">New Express Ainu-go
|
27 |
)
|
28 |
|
29 |
-
if __name__ ==
|
30 |
gradio_app.launch()
|
|
|
8 |
output_str = ''
|
9 |
|
10 |
for input in input_str.split('\n'):
|
11 |
+
input_enc = tokenizer.encode(input.strip(), return_tensors='pt')
|
12 |
output_enc = model.generate(input_enc, max_length=256)
|
13 |
|
14 |
if len(output_str) > 0:
|
|
|
23 |
inputs=gr.Textbox(label='Input (kana)', value='トゥイマ ヒ ワ エエㇰ ワ ヒオーイオイ。ピㇼカノ ヌカㇻ ヤン!', placeholder='トゥイマ ヒ ワ エエㇰ ワ ヒオーイオイ。ピㇼカノ ヌカㇻ ヤン!', info='Ainu text written in Japanese katakana (input).', interactive=True, autofocus=True),
|
24 |
outputs=gr.Textbox(label='Output (alphabet)', info='Ainu text written in the Latin alphabet (output).'),
|
25 |
title='BYT5 Ainu Kana-Latin Converter (V1)',
|
26 |
+
article='<p>Example sentence borrowed from <a href="https://www.hakusuisha.co.jp/book/b584600.html">New Express Ainu-go</a> by <a href="https://researchmap.jp/read0064265/?lang=english">NAKAGAWA Hiroshi</a></p>'
|
27 |
)
|
28 |
|
29 |
+
if __name__ == '__main__':
|
30 |
gradio_app.launch()
|