AhmadHazem
commited on
Commit
·
aae829f
1
Parent(s):
39561ce
Fixed Bug
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ from transformers.pipelines.audio_utils import ffmpeg_read
|
|
9 |
|
10 |
import tempfile
|
11 |
import os
|
12 |
-
import
|
13 |
|
14 |
MODEL_NAME = "openai/whisper-large-v3-turbo"
|
15 |
BATCH_SIZE = 8
|
@@ -32,7 +32,7 @@ tensors = {}
|
|
32 |
with safe_open("lora-opus-mt-en-ar\model.safetensors", framework="pt", device=0) as f:
|
33 |
for k in f.keys():
|
34 |
tensors[k] = f.get_tensor(k)
|
35 |
-
|
36 |
tokenizer_translation = MarianTokenizer.from_pretrained(model_name_translate)
|
37 |
model_translate = MarianMTModel.from_pretrained(model_path_translate, state_dict=tensors, config="lora-opus-mt-en-ar/config.json")
|
38 |
|
|
|
9 |
|
10 |
import tempfile
|
11 |
import os
|
12 |
+
from safetensors import safe_open
|
13 |
|
14 |
MODEL_NAME = "openai/whisper-large-v3-turbo"
|
15 |
BATCH_SIZE = 8
|
|
|
32 |
with safe_open("lora-opus-mt-en-ar\model.safetensors", framework="pt", device=0) as f:
|
33 |
for k in f.keys():
|
34 |
tensors[k] = f.get_tensor(k)
|
35 |
+
|
36 |
tokenizer_translation = MarianTokenizer.from_pretrained(model_name_translate)
|
37 |
model_translate = MarianMTModel.from_pretrained(model_path_translate, state_dict=tensors, config="lora-opus-mt-en-ar/config.json")
|
38 |
|