Spaces:
Sleeping
Sleeping
vteam27
commited on
Commit
·
24332df
1
Parent(s):
697e722
fixed bug
Browse files
app.py
CHANGED
@@ -18,7 +18,8 @@ processor = AutoProcessor.from_pretrained("facebook/hf-seamless-m4t-medium")
|
|
18 |
|
19 |
def run_t2tt(file_uploader , input_text: str, source_language: str, target_language: str) -> (str, bytes):
|
20 |
if file_uploader is not None:
|
21 |
-
|
|
|
22 |
source_language_code = LANGUAGE_NAME_TO_CODE[source_language]
|
23 |
target_language_code = LANGUAGE_NAME_TO_CODE[target_language]
|
24 |
text_inputs = processor(text = input_text, src_lang=source_language_code , return_tensors="pt")
|
|
|
18 |
|
19 |
def run_t2tt(file_uploader , input_text: str, source_language: str, target_language: str) -> (str, bytes):
|
20 |
if file_uploader is not None:
|
21 |
+
with open(file_uploader, 'r') as file:
|
22 |
+
input_text=file.read()
|
23 |
source_language_code = LANGUAGE_NAME_TO_CODE[source_language]
|
24 |
target_language_code = LANGUAGE_NAME_TO_CODE[target_language]
|
25 |
text_inputs = processor(text = input_text, src_lang=source_language_code , return_tensors="pt")
|