Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,9 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
3 |
from transformers import M2M100ForConditionalGeneration
|
4 |
from tokenization_small100 import SMALL100Tokenizer
|
5 |
|
6 |
-
langs = """
|
7 |
-
|
8 |
-
Slovenian (sl), Somali (so), Albanian (sq), Serbian (sr), Swati (ss), Sundanese (su), Swedish (sv), Swahili (sw), Tamil (ta), Thai (th), Tagalog (tl), Tswana (tn),
|
9 |
-
Turkish (tr), Ukrainian (uk), Urdu (ur), Uzbek (uz), Vietnamese (vi), Wolof (wo), Xhosa (xh), Yiddish (yi), Yoruba (yo), Chinese (zh), Zulu (zu)"""
|
10 |
-
lang_list = [lang.strip().split(" ")[-1][1:-1] for lang in langs.split(',')]
|
11 |
|
12 |
model = M2M100ForConditionalGeneration.from_pretrained("alirezamsh/small100")
|
13 |
tokenizer = SMALL100Tokenizer.from_pretrained("alirezamsh/small100")
|
@@ -32,5 +28,5 @@ with gr.Blocks(analytics_enabled=False) as app:
|
|
32 |
api_name="translate",
|
33 |
)
|
34 |
|
35 |
-
app.launch(
|
36 |
-
block.queue( concurrency_count=
|
|
|
1 |
import gradio as gr
|
|
|
2 |
from transformers import M2M100ForConditionalGeneration
|
3 |
from tokenization_small100 import SMALL100Tokenizer
|
4 |
|
5 |
+
langs = """af,am,ar,ast,az,ba,be,bg,bn,br,bs,ca,ceb,cs,cy,da,de,el,en,es,et,fa,ff,fi,fr,fy,ga,gd,gl,gu,ha,he,hi,hr,ht,hu,hy,id,ig,ilo,is,it,ja,jv,ka,kk,km,kn,ko,lb,lg,ln,lo,lt,lv,mg,mk,ml,mn,mr,ms,my,ne,nl,no,ns,oc,or,pa,pl,ps,pt,ro,ru,sd,si,sk,sl,so,sq,sr,ss,su,sv,sw,ta,th,tl,tn,tr,uk,ur,uz,vi,wo,xh,yi,yo,zh,zu"""
|
6 |
+
lang_list = langs.split(',')
|
|
|
|
|
|
|
7 |
|
8 |
model = M2M100ForConditionalGeneration.from_pretrained("alirezamsh/small100")
|
9 |
tokenizer = SMALL100Tokenizer.from_pretrained("alirezamsh/small100")
|
|
|
28 |
api_name="translate",
|
29 |
)
|
30 |
|
31 |
+
app.launch( inline=True )
|
32 |
+
block.queue( concurrency_count=8 )
|