Spaces:
Sleeping
Sleeping
JJFrancisco
commited on
Commit
•
696fe3b
1
Parent(s):
913041f
Update app.py
Browse files
app.py
CHANGED
@@ -2,8 +2,12 @@ import gradio as gr
|
|
2 |
|
3 |
import subprocess
|
4 |
|
|
|
|
|
|
|
|
|
5 |
def translate(input_text):
|
6 |
-
command = f"onmt_translate -src {input_text} -model
|
7 |
process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
8 |
stdout, stderr = process.communicate()
|
9 |
if process.returncode != 0:
|
|
|
2 |
|
3 |
import subprocess
|
4 |
|
5 |
+
model_dir_en_gl = download_model("proxectonos/Nos_MT-OpenNMT-en-gl", revision="main")
|
6 |
+
|
7 |
+
# NOS-MT-en-gl.p
|
8 |
+
|
9 |
def translate(input_text):
|
10 |
+
command = f"onmt_translate -src {input_text} -model model_dir_en_gl --output ./output_file.txt --replace_unk -gpu 0"
|
11 |
process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
12 |
stdout, stderr = process.communicate()
|
13 |
if process.returncode != 0:
|