Spaces:
Sleeping
Sleeping
use the bettertransformer pipeline
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
-
from
|
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")
|