Spaces:
Runtime error
Runtime error
Commit
·
25a0996
1
Parent(s):
afe7ae2
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
from transformers import pipeline
|
2 |
import gradio as gr
|
3 |
import os
|
4 |
|
@@ -8,7 +8,7 @@ def transcribe(audio):
|
|
8 |
text = pipe(audio)["text"]
|
9 |
return text
|
10 |
|
11 |
-
translation_pipeline = TranslationPipeline(
|
12 |
tokenizer=AutoTokenizer.from_pretrained(pretrained_model_name_or_path = "SEBIS/legal_t5_small_trans_sv_en",
|
13 |
do_lower_case=False,
|
14 |
skip_special_tokens=True),
|
|
|
1 |
+
from transformers import pipeline, AutoTokenizer, AutoModelWithLMHead, TranslationPipeline
|
2 |
import gradio as gr
|
3 |
import os
|
4 |
|
|
|
8 |
text = pipe(audio)["text"]
|
9 |
return text
|
10 |
|
11 |
+
translation_pipeline = TranslationPipeline(model=AutoModelWithLMHead.from_pretrained("SEBIS/legal_t5_small_trans_sv_en"),
|
12 |
tokenizer=AutoTokenizer.from_pretrained(pretrained_model_name_or_path = "SEBIS/legal_t5_small_trans_sv_en",
|
13 |
do_lower_case=False,
|
14 |
skip_special_tokens=True),
|