Spaces:
Sleeping
Sleeping
JJFrancisco
commited on
Commit
•
8997f2f
1
Parent(s):
86a205f
Update app.py
Browse files
app.py
CHANGED
@@ -2,14 +2,12 @@ import gradio as gr
|
|
2 |
|
3 |
import subprocess
|
4 |
|
5 |
-
|
6 |
-
return snapshot_download(repo_id=repo_id, revision=revision, local_dir=os.path.join(MODELS_PATH, repo_id), cache_dir=HF_CACHE_DIR)
|
7 |
-
model_dir_en_gl = download_model("proxectonos/Nos_MT-OpenNMT-en-gl", revision="main")
|
8 |
|
9 |
# NOS-MT-en-gl.p
|
10 |
|
11 |
def translate(input_text):
|
12 |
-
command = f"onmt_translate -src {input_text} -model
|
13 |
process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
14 |
stdout, stderr = process.communicate()
|
15 |
if process.returncode != 0:
|
|
|
2 |
|
3 |
import subprocess
|
4 |
|
5 |
+
git clone https://huggingface.co/proxectonos/Nos_MT-OpenNMT-en-gl
|
|
|
|
|
6 |
|
7 |
# NOS-MT-en-gl.p
|
8 |
|
9 |
def translate(input_text):
|
10 |
+
command = f"onmt_translate -src {input_text} -model NOS-MT-en-gl.p --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:
|