lgrobol commited on
Commit
0652b75
1 Parent(s): 992ecc8

use the bettertransformer pipeline

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import gradio as gr
2
- from transformers import pipeline
3
 
4
- pipeline = pipeline(task="translation", model="lgrobol/m2m100_418M_br_fr")
5
 
6
  def predict(texts):
7
  predictions = pipeline(texts.splitlines(), src_lang="br", tgt_lang="fr")
 
1
  import gradio as gr
2
+ from optimum.pipelines import pipeline
3
 
4
+ pipeline = pipeline(task="translation", model="lgrobol/m2m100_418M_br_fr", accelerator="bettertransformer")
5
 
6
  def predict(texts):
7
  predictions = pipeline(texts.splitlines(), src_lang="br", tgt_lang="fr")