razent commited on
Commit
501291b
1 Parent(s): 1cf603d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -3,16 +3,16 @@ from gradio.mix import Parallel, Series
3
 
4
  from transformers import pipeline
5
 
6
- summarizer = pipeline("translation", model="VietAI/envit5-mtet_phomt-translation", use_auth_token=True)
7
 
8
 
9
  def translate(inp):
10
  text = "en: " + inp
11
- res = summarizer(
12
  text,
13
  max_length=512,
14
  early_stopping=True,
15
- )[0]['translation_text']
16
  return res
17
 
18
 
@@ -28,7 +28,7 @@ iface = gr.Interface(fn=translate,
28
  label = 'Enter an article...'
29
  ),
30
  outputs = 'text',
31
- title = 'En->Vi MTet Translation',
32
  theme = 'grass',
33
  layout = 'horizontal',
34
  article=article,
 
3
 
4
  from transformers import pipeline
5
 
6
+ translater = pipeline("translation", model="VietAI/envit5-translation")
7
 
8
 
9
  def translate(inp):
10
  text = "en: " + inp
11
+ res = translater(
12
  text,
13
  max_length=512,
14
  early_stopping=True,
15
+ )[0]['translation_text'][3:]
16
  return res
17
 
18
 
 
28
  label = 'Enter an article...'
29
  ),
30
  outputs = 'text',
31
+ title = 'En<->Vi MTet Translation',
32
  theme = 'grass',
33
  layout = 'horizontal',
34
  article=article,