Skip to content

Commit

Permalink
Update app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
medahmedkrichen authored Dec 15, 2024
1 parent 4988f52 commit 54177fa
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,15 +357,14 @@ def __init__(self, Video_path, source_language, target_language,
'None': None}



if self.source_language == 'tr':
model_name = f"Helsinki-NLP/opus-mt-trk-{self.target_language}"
elif self.target_language == 'tr':
model_name = f"Helsinki-NLP/opus-mt-{self.source_language}-trk"
else:
model_name = f"Helsinki-NLP/opus-mt-{self.source_language}-{self.target_language}"

if self.source_language == 'zh-cn':
if self.source_language == 'zh-cn':
model_name = f"Helsinki-NLP/opus-mt-zh-{self.target_language}"
elif self.target_language == 'zh-cn':
model_name = f"Helsinki-NLP/opus-mt-{self.source_language}-zh"
Expand All @@ -376,8 +375,6 @@ def __init__(self, Video_path, source_language, target_language,
model = MarianMTModel.from_pretrained(model_name).to(device)

if not self.Context_translation:



# Function to translate text
def translate(sentence, model, tokenizer):
Expand Down

0 comments on commit 54177fa

Please sign in to comment.